Class: Ibanity::OAuthResource

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/ibanity/api/o_auth_resource.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ OAuthResource

Returns a new instance of OAuthResource.



15
16
17
# File 'lib/ibanity/api/o_auth_resource.rb', line 15

def initialize(raw)
  super(raw)
end

Class Method Details

.create_by_uri(uri:, payload:, idempotency_key: nil, headers: nil) ⇒ Object



3
4
5
6
7
# File 'lib/ibanity/api/o_auth_resource.rb', line 3

def self.create_by_uri(uri:, payload:, idempotency_key: nil, headers: nil)
  raw_item = Ibanity.client.post(uri: uri, payload: payload, json: false, idempotency_key: idempotency_key, headers: headers)
  raw_item = {} if raw_item == ""
  new(raw_item)
end

.find_by_uri(uri:, customer_access_token: nil, headers: nil) ⇒ Object



9
10
11
12
13
# File 'lib/ibanity/api/o_auth_resource.rb', line 9

def self.find_by_uri(uri:, customer_access_token: nil, headers: nil)
  raw_item = Ibanity.client.get(uri: uri, customer_access_token: customer_access_token, headers: headers)
  raw_item = {} if raw_item == ""
  new(raw_item)
end