Sha256: 6998a6647da70f03c7d0502d2d63b396e0f5324a84387ed8edf733d2bc40798e

Contents?: true

Size: 348 Bytes

Versions: 2

Compression:

Stored size: 348 Bytes

Contents

module Arrest
  class NestedAttribute < Attribute

    def initialize name, class_name, options
      super name, class_name, options
    end

    def from_hash(parent, value)
      return nil unless value != nil
      self.clazz.new(parent, value)
    end

    def to_hash val
      return nil unless val!= nil
      val.to_hash
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
arrest-0.0.91 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.90 lib/arrest/attributes/nested_attribute.rb