Class: DhtStub
- Inherits:
-
Object
- Object
- DhtStub
- Defined in:
- lib/dht_sensor/dht_stub.rb
Defined Under Namespace
Classes: NullLogger
Instance Attribute Summary collapse
-
#pin ⇒ Object
readonly
Note: #type and #pin are not yet available on the dth_sensor class.
-
#type ⇒ Object
readonly
Note: #type and #pin are not yet available on the dth_sensor class.
Instance Method Summary collapse
-
#initialize(type, pin, logger: NullLogger.new) ⇒ DhtStub
constructor
A new instance of DhtStub.
- #to_a ⇒ Object
Constructor Details
#initialize(type, pin, logger: NullLogger.new) ⇒ DhtStub
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/dht_sensor/dht_stub.rb', line 9 def initialize(type, pin, logger: NullLogger.new) @type = type logger.debug "DHT Type --> #{type}" @pin = pin logger.debug "DHT Pin --> #{pin}" @temperature = 42.0 @humidity = 69.0 self end |
Instance Attribute Details
#pin ⇒ Object (readonly)
Note: #type and #pin are not yet available on the dth_sensor class
7 8 9 |
# File 'lib/dht_sensor/dht_stub.rb', line 7 def pin @pin end |
#type ⇒ Object (readonly)
Note: #type and #pin are not yet available on the dth_sensor class
7 8 9 |
# File 'lib/dht_sensor/dht_stub.rb', line 7 def type @type end |
Instance Method Details
#to_a ⇒ Object
22 23 24 |
# File 'lib/dht_sensor/dht_stub.rb', line 22 def to_a [@temperature, @humidity] end |