Class: MC2P::ActionsResourceMixin
- Inherits:
-
ResourceMixin
- Object
- ResourceMixin
- MC2P::ActionsResourceMixin
- Defined in:
- lib/mixins.rb
Overview
Allows send requests of actions
Direct Known Subclasses
CardShareResourceMixin, ChargeResourceMixin, RefundCaptureVoidResourceMixin
Instance Method Summary collapse
-
#_one_item_action(func, resource_id, action, data = nil) ⇒ Object
- Params:
func
- function to make the request
resource_id
- id to use on the requested url
action
- action to use on the requested url
data
-
data passed in the request Returns: response dictionary.
- action to use on the requested url
- id to use on the requested url
- function to make the request
- Params:
-
#detail_action_url(resource_id, action) ⇒ Object
- Params:
resource_id
- id used on the url returned
action
-
action used on the url returned Returns: url to make an action in an item.
- id used on the url returned
- Params:
Methods inherited from ResourceMixin
#_one_item, #detail_url, #initialize
Constructor Details
This class inherits a constructor from MC2P::ResourceMixin
Instance Method Details
#_one_item_action(func, resource_id, action, data = nil) ⇒ Object
Params:
func
-
function to make the request
resource_id
-
id to use on the requested url
action
-
action to use on the requested url
data
-
data passed in the request
Returns: response dictionary
318 319 320 321 322 323 324 325 326 327 328 |
# File 'lib/mixins.rb', line 318 def _one_item_action(func, resource_id, action, data = nil) url = detail_action_url(resource_id, action) @api_request.send( func, url, data, nil, self, resource_id ) end |
#detail_action_url(resource_id, action) ⇒ Object
Params:
resource_id
-
id used on the url returned
action
-
action used on the url returned
Returns: url to make an action in an item
308 309 310 |
# File 'lib/mixins.rb', line 308 def detail_action_url(resource_id, action) "#{@path}#{resource_id}/#{action}/" end |