Class: CloudPayments::Namespaces::Base
- Inherits:
-
Object
- Object
- CloudPayments::Namespaces::Base
- Defined in:
- lib/cloud_payments/namespaces/base.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#parent_path ⇒ Object
readonly
Returns the value of attribute parent_path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(client, parent_path = nil) ⇒ Base
constructor
A new instance of Base.
- #request(path, params = {}) ⇒ Object
Constructor Details
#initialize(client, parent_path = nil) ⇒ Base
Returns a new instance of Base.
13 14 15 16 |
# File 'lib/cloud_payments/namespaces/base.rb', line 13 def initialize(client, parent_path = nil) @client = client @parent_path = parent_path end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/cloud_payments/namespaces/base.rb', line 5 def client @client end |
#parent_path ⇒ Object (readonly)
Returns the value of attribute parent_path.
5 6 7 |
# File 'lib/cloud_payments/namespaces/base.rb', line 5 def parent_path @parent_path end |
Class Method Details
.resource_name ⇒ Object
8 9 10 |
# File 'lib/cloud_payments/namespaces/base.rb', line 8 def resource_name self.name.split('::').last.downcase end |
Instance Method Details
#request(path, params = {}) ⇒ Object
18 19 20 21 22 |
# File 'lib/cloud_payments/namespaces/base.rb', line 18 def request(path, params = {}) response = client.perform_request(resource_path(path), params) raise_gateway_error(response.body) unless response.body[:success] response.body end |