class JSONAPI::Document::Jsonapi
The jsonapi top level member of a JSON:API document
Public Class Methods
new(jsonapi_member_arr = [])
click to toggle source
@param jsonapi_member_arr [Array<JSONAPI::Document::Jsonapi::JsonapiMember] The collection
of members to intialize this collection with.
Calls superclass method
JSONAPI::NameValuePairCollection::new
# File lib/easy/jsonapi/document/jsonapi.rb, line 14 def initialize(jsonapi_member_arr = []) super(jsonapi_member_arr, item_type: JSONAPI::Document::Jsonapi::JsonapiMember) end
Public Instance Methods
add(jsonapi_member)
click to toggle source
Add a jsonapi member to the collection @param jsonapi_member [JSONAPI::Document::Jsonapi::JsonapiMember] The member to add
Calls superclass method
JSONAPI::NameValuePairCollection#add
# File lib/easy/jsonapi/document/jsonapi.rb, line 20 def add(jsonapi_member) super(jsonapi_member, &:name) end