Class: BWA::Messages::SetTargetTemperature
- Inherits:
-
BWA::Message
- Object
- BWA::Message
- BWA::Messages::SetTargetTemperature
- Defined in:
- lib/bwa/messages/set_target_temperature.rb
Constant Summary collapse
- MESSAGE_TYPE =
"\xbf\x20".b
- MESSAGE_LENGTH =
1
Instance Attribute Summary collapse
-
#temperature ⇒ Object
Returns the value of attribute temperature.
Attributes inherited from BWA::Message
Instance Method Summary collapse
-
#initialize(temperature = nil) ⇒ SetTargetTemperature
constructor
A new instance of SetTargetTemperature.
- #inspect ⇒ Object
- #parse(data) ⇒ Object
- #serialize ⇒ Object
Methods inherited from BWA::Message
format_duration, format_time, inherited, #log?, parse
Constructor Details
#initialize(temperature = nil) ⇒ SetTargetTemperature
Returns a new instance of SetTargetTemperature.
11 12 13 14 |
# File 'lib/bwa/messages/set_target_temperature.rb', line 11 def initialize(temperature = nil) super() self.temperature = temperature end |
Instance Attribute Details
#temperature ⇒ Object
Returns the value of attribute temperature.
9 10 11 |
# File 'lib/bwa/messages/set_target_temperature.rb', line 9 def temperature @temperature end |
Instance Method Details
#inspect ⇒ Object
24 25 26 |
# File 'lib/bwa/messages/set_target_temperature.rb', line 24 def inspect "#<BWA::Messages::SetTargetTemperature #{temperature}°>" end |
#parse(data) ⇒ Object
16 17 18 |
# File 'lib/bwa/messages/set_target_temperature.rb', line 16 def parse(data) self.temperature = data[0].ord end |
#serialize ⇒ Object
20 21 22 |
# File 'lib/bwa/messages/set_target_temperature.rb', line 20 def serialize super(temperature.chr) end |