Sha256: 9f5b4172f1cc1636dd319adcbe9258e6cdf8f9aaef022de4665da36f58922056

Contents?: true

Size: 475 Bytes

Versions: 26

Compression:

Stored size: 475 Bytes

Contents

module Foobara
  module BuiltinTypes
    module Model
      module Casters
        class Hash < Attributes::Casters::Hash
          class << self
            def requires_parent_declaration_data?
              true
            end
          end

          def cast(attributes)
            model_class.new(super)
          end

          def model_class
            Object.const_get(parent_declaration_data[:model_class])
          end
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
foobara-0.0.26 projects/model/src/extensions/builtin_types/model/casters/hash.rb
foobara-0.0.25 projects/model/src/extensions/builtin_types/model/casters/hash.rb
foobara-0.0.24 projects/model/src/extensions/builtin_types/model/casters/hash.rb
foobara-0.0.23 projects/model/src/extensions/builtin_types/model/casters/hash.rb
foobara-0.0.22 projects/model/src/extensions/builtin_types/model/casters/hash.rb
foobara-0.0.21 projects/model/src/extensions/builtin_types/model/casters/hash.rb
foobara-0.0.20 projects/model/src/extensions/builtin_types/model/casters/hash.rb
foobara-0.0.19 projects/model/src/extensions/builtin_types/model/casters/hash.rb
foobara-0.0.18 projects/model/src/extensions/builtin_types/model/casters/hash.rb
foobara-0.0.17 projects/model/src/extensions/builtin_types/model/casters/hash.rb
foobara-0.0.16 projects/model/src/extensions/builtin_types/model/casters/hash.rb
foobara-0.0.15 projects/model/src/extensions/builtin_types/model/casters/hash.rb
foobara-0.0.14 projects/model/src/extensions/builtin_types/model/casters/hash.rb
foobara-0.0.13 projects/model/src/extensions/builtin_types/model/casters/hash.rb
foobara-0.0.12 projects/model/src/extensions/builtin_types/model/casters/hash.rb
foobara-0.0.11 projects/model/src/extensions/builtin_types/model/casters/hash.rb
foobara-0.0.10 projects/model/src/extensions/builtin_types/model/casters/hash.rb
foobara-0.0.9 projects/model/src/extensions/builtin_types/model/casters/hash.rb
foobara-0.0.8 projects/model/src/extensions/builtin_types/model/casters/hash.rb
foobara-0.0.7 projects/model/src/extensions/builtin_types/model/casters/hash.rb