Class: Cryptsy::ConfirmationPoller
- Inherits:
-
Object
- Object
- Cryptsy::ConfirmationPoller
- Defined in:
- lib/cryptsy/confirmation_poller.rb
Instance Method Summary collapse
-
#initialize(adapter, pattern) ⇒ ConfirmationPoller
constructor
A new instance of ConfirmationPoller.
- #run_once ⇒ Enumerable
- #run_until_found(sleep_interval = 3) ⇒ void
Constructor Details
#initialize(adapter, pattern) ⇒ ConfirmationPoller
Returns a new instance of ConfirmationPoller.
7 8 9 10 |
# File 'lib/cryptsy/confirmation_poller.rb', line 7 def initialize(adapter, pattern) @adapter = adapter @pattern = pattern end |
Instance Method Details
#run_once ⇒ Enumerable
13 14 15 16 17 18 19 20 21 |
# File 'lib/cryptsy/confirmation_poller.rb', line 13 def run_once links = [] @adapter.call do |email| scan_links(links, email) end links end |
#run_until_found(sleep_interval = 3) ⇒ void
This method returns an undefined value.
25 26 27 28 29 30 31 |
# File 'lib/cryptsy/confirmation_poller.rb', line 25 def run_until_found(sleep_interval = 3) loop do links = run_once return links unless links.empty? sleep sleep_interval end end |