Class: WeatherLink::SensorDataCollection
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- WeatherLink::SensorDataCollection
- Defined in:
- lib/weatherlink/sensor_data_collection.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #archive ⇒ Object
- #current_conditions ⇒ Object
- #health ⇒ Object
-
#initialize(client, sensors) ⇒ SensorDataCollection
constructor
A new instance of SensorDataCollection.
- #inspect ⇒ Object
- #to_s ⇒ Object
- #weather ⇒ Object
Constructor Details
#initialize(client, sensors) ⇒ SensorDataCollection
Returns a new instance of SensorDataCollection.
9 10 11 12 |
# File 'lib/weatherlink/sensor_data_collection.rb', line 9 def initialize(client, sensors) @client = client super(sensors) end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
7 8 9 |
# File 'lib/weatherlink/sensor_data_collection.rb', line 7 def client @client end |
Instance Method Details
#archive ⇒ Object
26 27 28 |
# File 'lib/weatherlink/sensor_data_collection.rb', line 26 def archive SensorDataCollection.new(client, select(&:archive?)) end |
#current_conditions ⇒ Object
22 23 24 |
# File 'lib/weatherlink/sensor_data_collection.rb', line 22 def current_conditions SensorDataCollection.new(client, select(&:current_conditions?)) end |
#health ⇒ Object
34 35 36 |
# File 'lib/weatherlink/sensor_data_collection.rb', line 34 def health SensorDataCollection.new(client, select(&:health?)) end |
#inspect ⇒ Object
18 19 20 |
# File 'lib/weatherlink/sensor_data_collection.rb', line 18 def inspect to_s end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/weatherlink/sensor_data_collection.rb', line 14 def to_s "#<#{self.class.name} (#{size} sensors)>" end |
#weather ⇒ Object
30 31 32 |
# File 'lib/weatherlink/sensor_data_collection.rb', line 30 def weather SensorDataCollection.new(client, select(&:weather?)) end |