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
- 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, #elements
Methods included from Labels
#create_label, #label, #label_sensors, #labels, #update_label_sensors
Methods included from Sensors
#create_sensor, #sensor, #sensor_timeseries, #sensors
Methods included from Organizations
#organization, #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 |
# File 'lib/helium/client.rb', line 24 def initialize(opts = {}) @api_key = opts.fetch(:api_key) @api_host = opts.fetch(:host, HOST) @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
34 35 36 |
# File 'lib/helium/client.rb', line 34 def debug? @debug == true end |
#inspect ⇒ Object
30 31 32 |
# File 'lib/helium/client.rb', line 30 def inspect "<Helium::Client @debug=#{@debug}>" end |