Sha256: 936c550435341ed83862135b4d3a9e82ac9b5fe956466ab61171df29e830eda3
Contents?: true
Size: 834 Bytes
Versions: 12
Compression:
Stored size: 834 Bytes
Contents
# frozen_string_literal: true require 'easy/jsonapi/name_value_pair_collection' require 'easy/jsonapi/document/jsonapi/jsonapi_member' # extension module JSONAPI class Document # The jsonapi top level member of a JSON:API document class Jsonapi < JSONAPI::NameValuePairCollection # @param jsonapi_member_arr [Array<JSONAPI::Document::Jsonapi::JsonapiMember] The collection # of members to intialize this collection with. def initialize(jsonapi_member_arr = []) super(jsonapi_member_arr, item_type: JSONAPI::Document::Jsonapi::JsonapiMember) end # Add a jsonapi member to the collection # @param jsonapi_member [JSONAPI::Document::Jsonapi::JsonapiMember] The member to add def add(jsonapi_member) super(jsonapi_member, &:name) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems