Class: AlsoEnergy::HardWare
- Inherits:
-
Object
- Object
- AlsoEnergy::HardWare
- Includes:
- APIConnection, HashWrangler
- Defined in:
- lib/also_energy/hardware.rb
Instance Method Summary collapse
- #get_bin_data(period_start, period_end, bin_size, query_blob) ⇒ Object
-
#initialize(params = {}) ⇒ HardWare
constructor
A new instance of HardWare.
Methods included from APIConnection
Methods included from HashWrangler
Constructor Details
#initialize(params = {}) ⇒ HardWare
Returns a new instance of HardWare.
18 19 20 |
# File 'lib/also_energy/hardware.rb', line 18 def initialize(params = {}) super(params) end |
Instance Method Details
#get_bin_data(period_start, period_end, bin_size, query_blob) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/also_energy/hardware.rb', line 22 def get_bin_data(period_start, period_end, bin_size, query_blob) = { 'als:sessionID' => session_id, 'als:fromLocal' => period_start, 'als:toLocal' => period_end, 'als:binSize' => bin_size, 'als:Fields' => query_blob } response = find_in_hash(:data_set, (connection.call(:get_bin_data, message: ).body)) response.nil? ? (fail QueryError, 'Query Failed!') : response end |