class Cryptsy::ConfirmationPoller

Public Class Methods

new(adapter, pattern) click to toggle source

@param [Object] adapter @param [Regexp] pattern

# File lib/cryptsy/confirmation_poller.rb, line 7
def initialize(adapter, pattern)
  @adapter = adapter
  @pattern = pattern
end

Public Instance Methods

run_once() click to toggle source

@return [Enumerable]

# 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) click to toggle source

@param [Integer] sleep_interval @return [void]

# 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

Private Instance Methods