Class: Ipay::Rest::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/ipay/rest/resource.rb

Direct Known Subclasses

TransactionResource

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Resource

Returns a new instance of Resource.



8
9
10
# File 'lib/ipay/rest/resource.rb', line 8

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



6
7
8
# File 'lib/ipay/rest/resource.rb', line 6

def client
  @client
end

Instance Method Details

#post(url, body:, headers: {}) ⇒ Object



12
13
14
15
# File 'lib/ipay/rest/resource.rb', line 12

def post(url, body:, headers: {})
  body[:hash] = create_hash(body.values.join(""))
  handle_response client.connection.post(url, body, default_headers.merge(headers))
end