Sha256: 380db1a7016919486bbc09aa454978d759dc5ac4e970d8df01fc7d5a4deb300b

Contents?: true

Size: 350 Bytes

Versions: 40

Compression:

Stored size: 350 Bytes

Contents

module Arrest
  class Ref
    include HasAttributes

    attribute :id, String
    attribute :type, String
  end

  class PolymorphicAttribute < NestedAttribute
    def initialize name, read_only
      super name, read_only, Ref
    end

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

Version data entries

40 entries across 40 versions & 1 rubygems

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