Class: Helium::Client

Inherits:
Object
  • Object
show all
Includes:
Elements, Http, Labels, Organizations, Sensors, Users, Utils
Defined in:
lib/helium/client.rb,
lib/helium/client/http.rb,
lib/helium/client/users.rb,
lib/helium/client/labels.rb,
lib/helium/client/sensors.rb,
lib/helium/client/elements.rb,
lib/helium/client/organizations.rb

Defined Under Namespace

Modules: Elements, Http, Labels, Organizations, Sensors, Users

Constant Summary

Constants included from Http

Http::API_VERSION, Http::BASE_HTTP_HEADERS, Http::HOST, Http::PROTOCOL

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Elements

#element, #elements, #update_element

Methods included from Labels

#delete_label, #label, #label_sensors, #labels, #new_label, #update_label, #update_label_sensors

Methods included from Sensors

#delete_sensor, #new_sensor, #sensor, #sensor_timeseries, #sensors, #update_sensor

Methods included from Organizations

#organization, #organization_users

Methods included from Users

#user

Methods included from Http

#delete, #get, #paginated_get, #patch, #post

Methods included from Utils

#datetime_to_iso

Constructor Details

#initialize(api_key:, debug: false) ⇒ Client

Returns a new instance of Client



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

def initialize(api_key:, debug: false)
  @api_key = api_key
  @debug = debug
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key



18
19
20
# File 'lib/helium/client.rb', line 18

def api_key
  @api_key
end

Instance Method Details

#debug?Boolean

Returns:

  • (Boolean)


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

def debug?
  @debug == true
end

#inspectObject



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

def inspect
  "<Helium::Client @debug=#{@debug}>"
end