Class: CardDB::BatchProxy
- Inherits:
-
Object
- Object
- CardDB::BatchProxy
- Defined in:
- lib/carddb/batch.rb
Overview
Proxy class for batching operations on a specific resource
Instance Method Summary collapse
-
#fetch(*args, **kwargs) ⇒ Object
Proxy fetch calls to the batch.
-
#get(*args, **kwargs) ⇒ Object
Proxy get calls to the batch.
- #get_by_external_ref(*args, **kwargs) ⇒ Object
-
#initialize(batch, resource) ⇒ BatchProxy
constructor
A new instance of BatchProxy.
Constructor Details
#initialize(batch, resource) ⇒ BatchProxy
Returns a new instance of BatchProxy.
356 357 358 359 |
# File 'lib/carddb/batch.rb', line 356 def initialize(batch, resource) @batch = batch @resource = resource end |
Instance Method Details
#fetch(*args, **kwargs) ⇒ Object
Proxy fetch calls to the batch
362 363 364 365 |
# File 'lib/carddb/batch.rb', line 362 def fetch(*args, **kwargs) @batch.add_operation(resource: @resource, method: :fetch, args: args, kwargs: kwargs) nil # Return nil since we're batching end |
#get(*args, **kwargs) ⇒ Object
Proxy get calls to the batch
368 369 370 371 |
# File 'lib/carddb/batch.rb', line 368 def get(*args, **kwargs) @batch.add_operation(resource: @resource, method: :get, args: args, kwargs: kwargs) nil # Return nil since we're batching end |
#get_by_external_ref(*args, **kwargs) ⇒ Object
373 374 375 376 |
# File 'lib/carddb/batch.rb', line 373 def get_by_external_ref(*args, **kwargs) @batch.add_operation(resource: @resource, method: :get_by_external_ref, args: args, kwargs: kwargs) nil # Return nil since we're batching end |