Sha256: 32b0bdb7cf91aae90f27535ac4a596a208bc5e3646eacfde0ea4a09da6879991

Contents?: true

Size: 335 Bytes

Versions: 7

Compression:

Stored size: 335 Bytes

Contents

module Arrest
    class NestedAttribute < Attribute
    def initialize name, clazz, options
      super name, clazz, options
    end

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

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
arrest-0.0.89 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.88 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.87 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.86 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.85 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.84 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.83.crud lib/arrest/attributes/nested_attribute.rb