Class: Handiv::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/handiv/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



10
11
12
13
14
# File 'lib/handiv/client.rb', line 10

def initialize(options = {})
  @options = options

  set_config_from_options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/handiv/client.rb', line 8

def options
  @options
end

Instance Method Details

#configurationObject Also known as: config



20
21
22
# File 'lib/handiv/client.rb', line 20

def configuration
  @configuration ||= Configuration.new
end

#configure {|configuration| ... } ⇒ Object

Yields:



29
30
31
32
# File 'lib/handiv/client.rb', line 29

def configure
  yield(configuration) if block_given?
  true
end

#connectionObject



25
26
27
# File 'lib/handiv/client.rb', line 25

def connection
  Connection.new(self)
end

#loggerObject



16
17
18
# File 'lib/handiv/client.rb', line 16

def logger
  @logger ||= Logger.new(self)
end

#report_task(task_id, options = {}) ⇒ Object



34
35
36
# File 'lib/handiv/client.rb', line 34

def report_task(task_id, options = {})
  Tasks::Reporter.new(self, task_id, options).report
end