• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / tigerdata-app / 5205f704-d89d-4c43-8cfa-9e6783edc33a

29 Feb 2024 07:04PM UTC coverage: 60.206% (-29.9%) from 90.092%
5205f704-d89d-4c43-8cfa-9e6783edc33a

push

circleci

jrgriffiniii
Ensuring that the storage usage and storage capacity is retrieved for
Mediaflux Projects and rendered on the "contents" Project View

11 of 34 new or added lines in 4 files covered. (32.35%)

451 existing lines in 34 files now uncovered.

935 of 1553 relevant lines covered (60.21%)

9.47 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

29.41
/app/models/mediaflux/http/schema_fields_create_request.rb
1
# frozen_string_literal: true
2
module Mediaflux
1✔
3
  module Http
1✔
4
    class SchemaFieldsCreateRequest < Request
1✔
5
      attr_reader :schema_name, :document, :description, :fields
1✔
6

7
      # Mediaflux service to use to define fields in a schema namespace
8
      # @return [String]
9
      def self.service
1✔
UNCOV
10
        "asset.doc.type.update"
×
11
      end
12

13
      def initialize(schema_name:, document:, description:, fields:, session_token:)
1✔
14
        super(session_token: session_token)
6✔
UNCOV
15
        @schema_name = schema_name
×
UNCOV
16
        @document = document
×
UNCOV
17
        @description = description
×
UNCOV
18
        @fields = fields
×
19
      end
20

21
      private
1✔
22

23
        def build_http_request_body(name:)
1✔
UNCOV
24
          super(name: name) do |xml|
×
UNCOV
25
            xml.args do
×
UNCOV
26
              xml.create true
×
UNCOV
27
              xml.description @description
×
UNCOV
28
              xml.type "#{@schema_name}:#{@document}"
×
UNCOV
29
              xml.definition do
×
UNCOV
30
                @fields.each do |field|
×
UNCOV
31
                  build_field(xml:, field:)
×
32
                end
33
              end
34
            end
35
          end
36
        end
37

38
        def build_field(xml:, field:)
1✔
UNCOV
39
          dup_field = field.deep_dup
×
UNCOV
40
          attributes =  dup_field.delete(:attributes)
×
UNCOV
41
          description = dup_field.delete(:description)
×
UNCOV
42
          xml.element(dup_field) do
×
UNCOV
43
            if attributes.present?
×
UNCOV
44
              attributes.each do |attribute|
×
UNCOV
45
                attr_description = attribute.delete(:description)
×
UNCOV
46
                xml.attribute(attribute) do
×
UNCOV
47
                  xml.description attr_description
×
48
                end
49
              end
50
            end
UNCOV
51
            if description.present?
×
UNCOV
52
              xml.description description
×
53
            end
54
          end
55
        end
56
    end
57
  end
58
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc