Class: CresIP::SerialData
- Inherits:
-
Object
- Object
- CresIP::SerialData
- Defined in:
- lib/cresip/serial.rb
Instance Attribute Summary collapse
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
Instance Method Summary collapse
-
#initialize(header, payload) ⇒ SerialData
constructor
A new instance of SerialData.
- #type ⇒ Object
Constructor Details
#initialize(header, payload) ⇒ SerialData
Returns a new instance of SerialData.
7 8 9 10 11 12 |
# File 'lib/cresip/serial.rb', line 7 def initialize(header, payload) @header = header @payload = payload @value = parse_serial_data(payload.bytes) end |
Instance Attribute Details
#header ⇒ Object (readonly)
Returns the value of attribute header.
14 15 16 |
# File 'lib/cresip/serial.rb', line 14 def header @header end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
14 15 16 |
# File 'lib/cresip/serial.rb', line 14 def payload @payload end |
Instance Method Details
#type ⇒ Object
16 17 18 |
# File 'lib/cresip/serial.rb', line 16 def type @header.type end |