Class: Helium::Client
- Inherits:
-
Object
- Object
- Helium::Client
- 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 collapse
- API_VERSION =
1- HOST =
'api.helium.com'- PROTOCOL =
'https'
Constants included from Http
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
Instance Method Summary collapse
- #debug? ⇒ Boolean
-
#initialize(opts = {}) ⇒ Client
constructor
A new instance of Client.
- #inspect ⇒ Object
Methods included from Elements
#element, #element_sensors, #element_timeseries, #elements
Methods included from Labels
#create_label, #label, #label_sensors, #labels, #update_label_sensors
Methods included from Sensors
#create_sensor, #sensor, #sensor_element, #sensor_timeseries, #sensors
Methods included from Organizations
#organization, #organization_elements, #organization_labels, #organization_sensors, #organization_users
Methods included from Users
Methods included from Http
#base_url, #delete, #get, #paginated_get, #patch, #post, #url_for
Methods included from Utils
Constructor Details
#initialize(opts = {}) ⇒ Client
Returns a new instance of Client.
24 25 26 27 28 29 |
# File 'lib/helium/client.rb', line 24 def initialize(opts = {}) @api_key = opts.fetch(:api_key) @api_host = opts.fetch(:host, HOST) @verify_peer = opts.fetch(:verify_peer, true) @debug = opts.fetch(:debug, false) end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
22 23 24 |
# File 'lib/helium/client.rb', line 22 def api_key @api_key end |
Instance Method Details
#debug? ⇒ Boolean
35 36 37 |
# File 'lib/helium/client.rb', line 35 def debug? @debug == true end |
#inspect ⇒ Object
31 32 33 |
# File 'lib/helium/client.rb', line 31 def inspect "<Helium::Client @debug=#{@debug}>" end |