Sha256: afcc8d2e67e5e0b53f370743635fa69f71558169f517db78b11cf8cca1ff5d1e

Contents?: true

Size: 724 Bytes

Versions: 2

Compression:

Stored size: 724 Bytes

Contents

# typed: strict
# frozen_string_literal: true

require "sorbet-runtime"

require "nexus/invision/value_object"
require "nexus/invision/resources/field"

module Nexus
  module Invision
    module Resources
      class FieldGroup < T::Struct
        include ValueObject

        const :name, Integer
        const :fields, T::Hash[String, Field]

        class << self
          extend T::Sig

          sig { params(response: T::Hash[String, T.untyped]).returns(FieldGroup) }
          def from_response(response)
            FieldGroup.new(
              name: response["name"],
              fields: response["fields"].map { |f| Field.from_response(f) },
            )
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nexus-invision-1.11.0 lib/nexus/invision/resources/field_group.rb
nexus-invision-1.10.2 lib/nexus/invision/resources/field_group.rb