Sha256: a3db9eea7a1d37dc38ee74943bae11f21824943d388e56c31e81b7ce094702d0

Contents?: true

Size: 438 Bytes

Versions: 6

Compression:

Stored size: 438 Bytes

Contents

module Virtus
  class Attribute
    class EmbeddedValue < Object

      # EmbeddedValue attribute handling Struct primitive
      #
      class FromStruct < EmbeddedValue

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

      end # class FromStruct
    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_struct.rb
virtus-0.5.4 lib/virtus/attribute/embedded_value/from_struct.rb
virtus-0.5.3 lib/virtus/attribute/embedded_value/from_struct.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/virtus-0.5.2/lib/virtus/attribute/embedded_value/from_struct.rb
virtus-0.5.2 lib/virtus/attribute/embedded_value/from_struct.rb
virtus-0.5.1 lib/virtus/attribute/embedded_value/from_struct.rb