Sha256: 1b873b47f53369327b576e0f7edaba227fcffe8fed09fa808516cae57d973842

Contents?: true

Size: 466 Bytes

Versions: 6

Compression:

Stored size: 466 Bytes

Contents

module Virtus
  class Attribute
    class EmbeddedValue < Object

      # EmbeddedValue attribute handling OpenStruct primitive or Virtus object
      #
      class FromOpenStruct < EmbeddedValue

        # @api private
        def coerce(attributes)
          unless attributes.nil?
            super or @primitive.new(attributes)
          end
        end

      end # class FromOpenStruct
    end # class EmbeddedValue
  end # class Attribute
end # module Virtus

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
virtus-0.5.5 lib/virtus/attribute/embedded_value/from_open_struct.rb
virtus-0.5.4 lib/virtus/attribute/embedded_value/from_open_struct.rb
virtus-0.5.3 lib/virtus/attribute/embedded_value/from_open_struct.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/virtus-0.5.2/lib/virtus/attribute/embedded_value/from_open_struct.rb
virtus-0.5.2 lib/virtus/attribute/embedded_value/from_open_struct.rb
virtus-0.5.1 lib/virtus/attribute/embedded_value/from_open_struct.rb