Class: WeatherLink::Sensor
- Inherits:
-
HashWrapper
- Object
- SimpleDelegator
- HashWrapper
- WeatherLink::Sensor
- Defined in:
- lib/weatherlink/sensor.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Attributes inherited from HashWrapper
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(client, data) ⇒ Sensor
constructor
A new instance of Sensor.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(client, data) ⇒ Sensor
Returns a new instance of Sensor.
7 8 9 10 |
# File 'lib/weatherlink/sensor.rb', line 7 def initialize(client, data) @client = client super(data) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class WeatherLink::HashWrapper
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/weatherlink/sensor.rb', line 5 def client @client end |
Instance Method Details
#description ⇒ Object
20 21 22 |
# File 'lib/weatherlink/sensor.rb', line 20 def description "#{manufacturer} - #{product_name}" end |
#inspect ⇒ Object
16 17 18 |
# File 'lib/weatherlink/sensor.rb', line 16 def inspect to_s end |
#to_s ⇒ Object
12 13 14 |
# File 'lib/weatherlink/sensor.rb', line 12 def to_s "#<#{self.class.name} lsid=#{lsid} (#{description})>" end |