Class: Upkey::Helios::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Client

Returns a new instance of Client.



16
17
18
19
20
21
22
# File 'lib/upkey/helios/client.rb', line 16

def initialize(args = {})
  raise MissingArgumentError unless args[:access_key] && args[:helios_url]

  @access_key = args[:access_key]
  @helios_url = args[:helios_url]
  @conn = set_up_faraday
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object



24
25
26
27
28
29
# File 'lib/upkey/helios/client.rb', line 24

def method_missing(*args)
  args[2].nil? ? (params = {}) : (params = args[2])
  response = Upkey::Helios::Accessor.query(self, args[0], args[1], params)

  Upkey::Helios::Responder.parse(response)
end

Instance Attribute Details

#access_keyObject (readonly)

Returns the value of attribute access_key.



14
15
16
# File 'lib/upkey/helios/client.rb', line 14

def access_key
  @access_key
end

#connObject (readonly)

Returns the value of attribute conn.



14
15
16
# File 'lib/upkey/helios/client.rb', line 14

def conn
  @conn
end

#helios_urlObject (readonly)

Returns the value of attribute helios_url.



14
15
16
# File 'lib/upkey/helios/client.rb', line 14

def helios_url
  @helios_url
end