Sha256: 1615eeee17f017604b539171968e1386d2c0d4f5284b869405a0161a94ad55d9

Contents?: true

Size: 339 Bytes

Versions: 58

Compression:

Stored size: 339 Bytes

Contents

module Arrest
    class NestedAttribute < Attribute
    def initialize name, read_only, clazz
      super name, read_only, clazz
    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

58 entries across 58 versions & 1 rubygems

Version Path
arrest-0.0.83.1 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.83 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.82 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.80 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.79 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.78 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.77 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.76 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.75 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.74 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.73 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.72 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.71 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.70 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.69 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.68 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.67 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.66 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.65 lib/arrest/attributes/nested_attribute.rb
arrest-0.0.64 lib/arrest/attributes/nested_attribute.rb