Class: BWA::Messages::SetTargetTemperature

Inherits:
BWA::Message show all
Defined in:
lib/bwa/messages/set_target_temperature.rb

Constant Summary collapse

MESSAGE_TYPE =
"\xbf\x20".b
MESSAGE_LENGTH =
1

Instance Attribute Summary collapse

Attributes inherited from BWA::Message

#raw_data, #src

Instance Method Summary collapse

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

#temperatureObject

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

#inspectObject



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

#serializeObject



20
21
22
# File 'lib/bwa/messages/set_target_temperature.rb', line 20

def serialize
  super(temperature.chr)
end