Class: Patreon::IdentityResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/patreon/resources/identity.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Patreon::Resource

Instance Method Details

#memberships(fields: Member::DEFAULT_FIELDS) ⇒ Object



9
10
11
12
# File 'lib/patreon/resources/identity.rb', line 9

def memberships(fields: Member::DEFAULT_FIELDS)
  response = get_request("identity?include=memberships&fields[member]=#{fields}")
  Collection.from_response(response, type: Member, key: "included")
end

#retrieve(fields: Identity::DEFAULT_FIELDS) ⇒ Object



4
5
6
7
# File 'lib/patreon/resources/identity.rb', line 4

def retrieve(fields: Identity::DEFAULT_FIELDS)
  response = get_request("identity?fields[user]=#{fields}")
  User.new response.body["data"]
end