Class: ApiClientBulkLoader::Client::BulkLoadAdapter
- Inherits:
-
Object
- Object
- ApiClientBulkLoader::Client::BulkLoadAdapter
- Defined in:
- lib/api_client_bulk_loader/client/bulk_load_adapter.rb
Overview
Adapts into the bulk loader. Mainly useful for storing the details of the bulk call.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#autoload ⇒ Object
readonly
Returns the value of attribute autoload.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#values_from ⇒ Object
readonly
Returns the value of attribute values_from.
Instance Method Summary collapse
- #bulk_loader ⇒ Object
- #fetch ⇒ Object
-
#initialize(attribute = nil, values_from = nil, autoload = false, is_has_one = false, limit = nil) ⇒ BulkLoadAdapter
constructor
A new instance of BulkLoadAdapter.
- #push ⇒ Object
Constructor Details
#initialize(attribute = nil, values_from = nil, autoload = false, is_has_one = false, limit = nil) ⇒ BulkLoadAdapter
7 8 9 10 11 12 13 |
# File 'lib/api_client_bulk_loader/client/bulk_load_adapter.rb', line 7 def initialize(attribute = nil, values_from = nil, autoload = false, is_has_one = false, limit = nil) @attribute = attribute @autoload = autoload @values_from = values_from || "#{attribute}_id" @has_one = is_has_one @limit = limit end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
5 6 7 |
# File 'lib/api_client_bulk_loader/client/bulk_load_adapter.rb', line 5 def attribute @attribute end |
#autoload ⇒ Object (readonly)
Returns the value of attribute autoload.
5 6 7 |
# File 'lib/api_client_bulk_loader/client/bulk_load_adapter.rb', line 5 def autoload @autoload end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
5 6 7 |
# File 'lib/api_client_bulk_loader/client/bulk_load_adapter.rb', line 5 def limit @limit end |
#values_from ⇒ Object (readonly)
Returns the value of attribute values_from.
5 6 7 |
# File 'lib/api_client_bulk_loader/client/bulk_load_adapter.rb', line 5 def values_from @values_from end |
Instance Method Details
#bulk_loader ⇒ Object
15 16 17 18 |
# File 'lib/api_client_bulk_loader/client/bulk_load_adapter.rb', line 15 def bulk_loader RequestStore.store[:bulk_loader] ||= ApiClientBulkLoader::Client::Loader.new return RequestStore.store[:bulk_loader] end |
#fetch ⇒ Object
24 25 26 |
# File 'lib/api_client_bulk_loader/client/bulk_load_adapter.rb', line 24 def fetch raise Exception.new("Child class should define fetch!") end |
#push ⇒ Object
20 21 22 |
# File 'lib/api_client_bulk_loader/client/bulk_load_adapter.rb', line 20 def push raise Exception.new("Child class should define push!") end |