Class: Streamworker::Workers::ShopifyWorker
- Defined in:
- lib/streamworker/workers/shopify_worker.rb
Constant Summary
Constants inherited from Worker
Worker::QUERIES_PER_BLOCK, Worker::TIMEOUT_MARGIN, Worker::TIME_PER_BLOCK
Instance Attribute Summary collapse
-
#credit_threshold ⇒ Object
Returns the value of attribute credit_threshold.
Attributes inherited from Worker
#footer_messages, #line_num, #num_errors, #num_records, #num_success, #opts, #repeats, #title, #view_context
Instance Method Summary collapse
-
#initialize(view_context, opts = {}) ⇒ ShopifyWorker
constructor
A new instance of ShopifyWorker.
- #with_shopify_session ⇒ Object
Methods inherited from Worker
#calculate_times, #close_report_line, #each, #error_line_num, #foot, #footer, #fragment?, #head, #header, #imminent_timeout?, #num_queries, #open_report_line, #projected_queries, #push_footer_message, #queries_per_record, #report_error, #report_fragment, #report_line, #report_timeout_footer, #scroll, #set_headers, #success_line_num
Constructor Details
#initialize(view_context, opts = {}) ⇒ ShopifyWorker
Returns a new instance of ShopifyWorker.
7 8 9 10 |
# File 'lib/streamworker/workers/shopify_worker.rb', line 7 def initialize(view_context, opts={}) @credit_threshold = 28 super view_context, opts end |
Instance Attribute Details
#credit_threshold ⇒ Object
Returns the value of attribute credit_threshold.
5 6 7 |
# File 'lib/streamworker/workers/shopify_worker.rb', line 5 def credit_threshold @credit_threshold end |
Instance Method Details
#with_shopify_session ⇒ Object
12 13 14 15 16 17 |
# File 'lib/streamworker/workers/shopify_worker.rb', line 12 def with_shopify_session ShopifyAPI::Base.activate_session(opts[:session]) yield ensure ShopifyAPI::Base.clear_session end |