class AParserClient::Control

Attributes

driver[R]
tasks[R]

Public Class Methods

new(api_driver) click to toggle source
# File lib/a_parser_client.rb, line 12
def initialize(api_driver)
  @driver = api_driver

  raise 'No API driver provided.' unless @driver

  raise 'API driver should be alive to take control of parser.' unless @driver.alive?

  @tasks = fetch_tasks
end

Public Instance Methods

fetch_tasks() click to toggle source
# File lib/a_parser_client.rb, line 22
def fetch_tasks
  data = @driver.get_tasks_list
  data['data'] || []
end