Class: MC2P::CRResource
- Inherits:
-
ReadOnlyResource
- Object
- ResourceMixin
- Resource
- DetailOnlyResource
- ReadOnlyResource
- MC2P::CRResource
- Defined in:
- lib/base.rb
Overview
Resource that allows send requests of create, list and detail
Direct Known Subclasses
AuthorizationResource, CRUDResource, SubscriptionResource, TransactionResource
Instance Method Summary collapse
-
#create(data) ⇒ Object
- Params:
data
-
data used on the request Returns: an object item class with the response of the server.
- Params:
-
#initialize(api_request, path, object_item_class) ⇒ CRResource
constructor
- Initializes a resource Params:
api_request
- Api request used to make all the requests to the API
path
- Path used to make all the requests to the API
object_item_class
-
Object item class used to return values.
- Path used to make all the requests to the API
- Api request used to make all the requests to the API
- Initializes a resource Params:
Methods inherited from ReadOnlyResource
Methods inherited from DetailOnlyResource
Methods inherited from ResourceMixin
Constructor Details
#initialize(api_request, path, object_item_class) ⇒ CRResource
Initializes a resource Params:
api_request
-
Api request used to make all the requests to the API
path
-
Path used to make all the requests to the API
object_item_class
-
Object item class used to return values
284 285 286 287 288 289 |
# File 'lib/base.rb', line 284 def initialize(api_request, path, object_item_class) super(api_request, path, object_item_class) @create_resource_mixin = CreateResourceMixin.new(api_request, path, object_item_class, @paginator_class) end |
Instance Method Details
#create(data) ⇒ Object
Params:
data
-
data used on the request
Returns: an object item class with the response of the server
294 295 296 |
# File 'lib/base.rb', line 294 def create(data) @create_resource_mixin.create(data) end |