Class: Ipay::Rest::Resource
- Inherits:
-
Object
- Object
- Ipay::Rest::Resource
- Defined in:
- lib/ipay/rest/resource.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize(client) ⇒ Resource
constructor
A new instance of Resource.
- #post(url, body:, headers: {}) ⇒ Object
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
#client ⇒ Object (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 |