Class: MC2P::Authorization
- Inherits:
-
PayURLCRObjectItem
- Object
- ObjectItemMixin
- ObjectItem
- ReadOnlyObjectItem
- CRObjectItem
- PayURLCRObjectItem
- MC2P::Authorization
- Defined in:
- lib/objects.rb
Overview
Authorization object
Instance Attribute Summary
Attributes inherited from ObjectItemMixin
#_deleted, #json_dict, #resource
Instance Method Summary collapse
-
#charge(data = nil) ⇒ Object
- Charge the object item Params:
data
-
data to send Returns: response dictionary.
- Charge the object item Params:
-
#initialize(json_dict, resource) ⇒ Authorization
constructor
- Initializes an object item Params:
json_dict
- Data of the object
resource
-
Resource used to delete, save, create or retrieve the object.
- Data of the object
- Initializes an object item Params:
Methods inherited from PayURLCRObjectItem
Methods inherited from CRObjectItem
Methods inherited from ReadOnlyObjectItem
Methods inherited from ObjectItem
#method_missing, #respond_to?, #respond_to_missing?, #set
Methods inherited from ObjectItemMixin
#id_required_and_not_deleted, #to_s
Constructor Details
#initialize(json_dict, resource) ⇒ Authorization
Initializes an object item Params:
json_dict
-
Data of the object
resource
-
Resource used to delete, save, create or retrieve the object
44 45 46 47 |
# File 'lib/objects.rb', line 44 def initialize(json_dict, resource) super(json_dict, resource) @charge_mixin = ChargeObjectItemMixin.new(json_dict, resource) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class MC2P::ObjectItem
Instance Method Details
#charge(data = nil) ⇒ Object
Charge the object item Params:
data
-
data to send
Returns: response dictionary
53 54 55 56 57 58 59 |
# File 'lib/objects.rb', line 53 def charge(data = nil) @charge_mixin.json_dict = @json_dict @charge_mixin._deleted = @_deleted @charge_mixin.charge(data) @json_dict = @charge_mixin.json_dict @_deleted = @charge_mixin._deleted end |