class JSONAPI::Document::Resource::Attributes

The attributes of a resource

Public Class Methods

new(attr_arr = []) click to toggle source

@param attr_arr [Array<JSONAPI::Document::Resource::Attributes::Attribute]

The collection of attributes to initialize the collection with.
Calls superclass method JSONAPI::NameValuePairCollection::new
# File lib/easy/jsonapi/document/resource/attributes.rb, line 14
def initialize(attr_arr = [])
  super(attr_arr, item_type: JSONAPI::Document::Resource::Attributes::Attribute)
end

Public Instance Methods

add(attribute) click to toggle source

Add a jsonapi member to the collection @param attribute [JSONAPI::Document::Resource::Attributes::Attribute] The member to add

Calls superclass method JSONAPI::NameValuePairCollection#add
# File lib/easy/jsonapi/document/resource/attributes.rb, line 20
def add(attribute)
  super(attribute, &:name)
end