Sha256: 68bc81221a1ad2f8ed3d82e15c4c40423e5af751df65c1646a6c1b439ed36341

Contents?: true

Size: 1.13 KB

Versions: 12

Compression:

Stored size: 1.13 KB

Contents

# frozen_string_literal: true

require 'easy/jsonapi/name_value_pair_collection'
require 'easy/jsonapi/document/resource/attributes/attribute'

module JSONAPI
  class Document
    class Resource
      # The attributes of a resource
      class Attributes < JSONAPI::NameValuePairCollection
  
        # @param attr_arr [Array<JSONAPI::Document::Resource::Attributes::Attribute] 
        #   The collection of attributes to initialize the collection with.
        def initialize(attr_arr = [])
          super(attr_arr, item_type: JSONAPI::Document::Resource::Attributes::Attribute)
        end

        # Add a jsonapi member to the collection
        # @param attribute [JSONAPI::Document::Resource::Attributes::Attribute] The member to add
        def add(attribute)
          super(attribute, &:name)
        end

        # #empyt? provided by super
        # #include provided by super
        # #add provided by super
        # #each provided from super
        # #remove provided from super
        # #get provided by super
        # #keys provided by super
        # #size provided by super

        # to_s provided from super
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
easy-jsonapi-1.0.11 lib/easy/jsonapi/document/resource/attributes.rb
easy-jsonapi-1.0.10 lib/easy/jsonapi/document/resource/attributes.rb
easy-jsonapi-1.0.9 lib/easy/jsonapi/document/resource/attributes.rb
easy-jsonapi-1.0.8 lib/easy/jsonapi/document/resource/attributes.rb
easy-jsonapi-1.0.7 lib/easy/jsonapi/document/resource/attributes.rb
easy-jsonapi-1.0.6 lib/easy/jsonapi/document/resource/attributes.rb
easy-jsonapi-1.0.5 lib/easy/jsonapi/document/resource/attributes.rb
easy-jsonapi-1.0.4 lib/easy/jsonapi/document/resource/attributes.rb
easy-jsonapi-1.0.3 lib/easy/jsonapi/document/resource/attributes.rb
easy-jsonapi-1.0.2 lib/easy/jsonapi/document/resource/attributes.rb
easy-jsonapi-1.0.1 lib/easy/jsonapi/document/resource/attributes.rb
easy-jsonapi-1.0.0 lib/easy/jsonapi/document/resource/attributes.rb