Class: Sunscout::SolarLog::Client
- Inherits:
-
Object
- Object
- Sunscout::SolarLog::Client
- Defined in:
- lib/sunscout/solar_log/client.rb
Overview
Low-level binding to the SolarLog HTTP API
Instance Method Summary collapse
-
#get_data ⇒ Hash<Symbol, String|Integer>
Retrieve data from the HTTP API.
-
#initialize(host, opts = {}) ⇒ Client
constructor
Initialize a new instance of the class.
Constructor Details
#initialize(host, opts = {}) ⇒ Client
Initialize a new instance of the class.
29 30 31 32 33 |
# File 'lib/sunscout/solar_log/client.rb', line 29 def initialize(host, opts = {}) @host = host @ssh_gateway = opts.fetch(:ssh_gateway, nil) end |
Instance Method Details
#get_data ⇒ Hash<Symbol, String|Integer>
Retrieve data from the HTTP API.
37 38 39 40 41 42 43 |
# File 'lib/sunscout/solar_log/client.rb', line 37 def get_data if @ssh_gateway get_data_ssh else get_data_direct end end |