Sha256: 7bbc9532bbc0bdbe7128cfdecc4fd6c8def9c9d81a252ab748c7e86650cc220a

Contents?: true

Size: 1016 Bytes

Versions: 12

Compression:

Stored size: 1016 Bytes

Contents

# frozen_string_literal: true

require 'easy/jsonapi/name_value_pair_collection'
require 'easy/jsonapi/document/links/link' # extension
require 'easy/jsonapi/utility'

module JSONAPI
  class Document
    
    # The links of a resource
    class Links < JSONAPI::NameValuePairCollection

      # @param link_arr [Array<JSONAPI::Document::Links::Link] The array
      #   of links to initialize this collection with.
      def initialize(link_arr = [])
        super(link_arr, item_type: JSONAPI::Document::Links::Link)
      end

      # Add a jsonapi member to the collection
      # @param link [JSONAPI::Document::Links:Link] The member to add
      def add(link)
        super(link, &:name)
      end
    end
  end
end

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

Version data entries

12 entries across 12 versions & 1 rubygems

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