Class: Helium::SensorPackage
- Defined in:
- lib/helium/helium_script.rb
Instance Attribute Summary collapse
-
#loaded ⇒ Object
readonly
Returns the value of attribute loaded.
Attributes inherited from Resource
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ SensorPackage
constructor
A new instance of SensorPackage.
-
#package ⇒ Object
Package is immutable and can be cached.
-
#sensor ⇒ Object
Sensor is not immutable (name can change), and should not be cached.
Methods inherited from Resource
#==, all, all_path, #as_json, create, #created_at, #destroy, #eql?, find, #hash, initialize_from_path, #metadata, resource_name, #resource_name, #resource_path, singleton, #to_json, #update, #updated_at
Methods included from Utils
Constructor Details
#initialize(opts = {}) ⇒ SensorPackage
Returns a new instance of SensorPackage.
57 58 59 60 |
# File 'lib/helium/helium_script.rb', line 57 def initialize(opts = {}) super(opts) @loaded = @params.dig('meta', 'loaded') end |
Instance Attribute Details
#loaded ⇒ Object (readonly)
Returns the value of attribute loaded.
55 56 57 |
# File 'lib/helium/helium_script.rb', line 55 def loaded @loaded end |
Instance Method Details
#package ⇒ Object
Package is immutable and can be cached
68 69 70 71 |
# File 'lib/helium/helium_script.rb', line 68 def package @package ||= Package.initialize_from_path(path: "#{resource_path}/package", client: @client) end |
#sensor ⇒ Object
Sensor is not immutable (name can change), and should not be cached
63 64 65 |
# File 'lib/helium/helium_script.rb', line 63 def sensor Sensor.initialize_from_path(path: "#{resource_path}/sensor", client: @client) end |