Class: MachineShop::DataSources
- Inherits:
-
APIResource
- Object
- MachineShopObject
- APIResource
- MachineShop::DataSources
- Defined in:
- lib/machineshop/data_sources.rb
Instance Attribute Summary
Attributes inherited from MachineShopObject
Instance Method Summary collapse
- #delete ⇒ Object
- #meters(filters = {}) ⇒ Object
-
#report_count(params) ⇒ Object
Specific API calls.
- #reports(filters = {}) ⇒ Object
Methods included from APIOperations::Update
Methods included from APIOperations::Create
Methods included from APIOperations::List
Methods inherited from APIResource
class_name, #refresh, retrieve, url, #url
Methods inherited from MachineShopObject
#[], #[]=, #as_json, construct_from, #each, #initialize, #inspect, #keys, #refresh_from, #to_hash, #to_json, #to_s, #values
Constructor Details
This class inherits a constructor from MachineShop::MachineShopObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class MachineShop::MachineShopObject
Instance Method Details
#delete ⇒ Object
24 25 26 |
# File 'lib/machineshop/data_sources.rb', line 24 def delete MachineShop.gem_delete("/platform/data_sources/#{self.id}?_type=#{self._type}", @auth_token,{}) end |
#meters(filters = {}) ⇒ Object
19 20 21 22 |
# File 'lib/machineshop/data_sources.rb', line 19 def meters(filters={}) filters.merge!(:device_instance_id => self.id) MachineShop::Meter.all(filters, @auth_token) end |
#report_count(params) ⇒ Object
Specific API calls
10 11 12 |
# File 'lib/machineshop/data_sources.rb', line 10 def report_count(params) MachineShop.gem_get(report_count_url, @auth_token, params) end |
#reports(filters = {}) ⇒ Object
14 15 16 17 |
# File 'lib/machineshop/data_sources.rb', line 14 def reports(filters={}) filters.merge!(:device_instance_id => self.id) MachineShop::Report.all(filters, @auth_token) end |