Sha256: a9c30c52c3d169b0fdf7d94f9ffcab3a0c365d34c496367277bb4c8634430db8

Contents?: true

Size: 542 Bytes

Versions: 24

Compression:

Stored size: 542 Bytes

Contents

# frozen_string_literal: true

require "fmrest/spyke/container_field"

module FmRest
  module Spyke
    module Model
      module ContainerFields
        extend ::ActiveSupport::Concern

        class_methods do
          def container(name, options = {})
            field_name = options[:field_name] || name

            define_method(name) do
              @container_fields ||= {}
              @container_fields[name.to_sym] ||= ContainerField.new(self, field_name)
            end
          end
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
fmrest-0.11.1 lib/fmrest/spyke/model/container_fields.rb
fmrest-0.11.0 lib/fmrest/spyke/model/container_fields.rb
fmrest-0.10.1 lib/fmrest/spyke/model/container_fields.rb
fmrest-0.10.0 lib/fmrest/spyke/model/container_fields.rb
fmrest-0.9.0 lib/fmrest/spyke/model/container_fields.rb
fmrest-0.8.0 lib/fmrest/spyke/model/container_fields.rb
fmrest-0.7.1 lib/fmrest/spyke/model/container_fields.rb
fmrest-0.7.0 lib/fmrest/spyke/model/container_fields.rb
fmrest-0.6.0 lib/fmrest/spyke/model/container_fields.rb
fmrest-0.5.2 lib/fmrest/spyke/model/container_fields.rb
fmrest-0.5.1 lib/fmrest/spyke/model/container_fields.rb
fmrest-0.5.0 lib/fmrest/spyke/model/container_fields.rb
fmrest-0.4.1 lib/fmrest/spyke/model/container_fields.rb
fmrest-0.4.0 lib/fmrest/spyke/model/container_fields.rb
fmrest-0.3.3 lib/fmrest/spyke/model/container_fields.rb
fmrest-0.3.2 lib/fmrest/spyke/model/container_fields.rb
fmrest-0.3.1 lib/fmrest/spyke/model/container_fields.rb
fmrest-0.3.0 lib/fmrest/spyke/model/container_fields.rb
fmrest-0.2.5 lib/fmrest/spyke/model/container_fields.rb
fmrest-0.2.4 lib/fmrest/spyke/model/container_fields.rb