Class: CresIP::SerialData

Inherits:
Object
  • Object
show all
Defined in:
lib/cresip/serial.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#headerObject (readonly)

Returns the value of attribute header.



14
15
16
# File 'lib/cresip/serial.rb', line 14

def header
  @header
end

#payloadObject (readonly)

Returns the value of attribute payload.



14
15
16
# File 'lib/cresip/serial.rb', line 14

def payload
  @payload
end

Instance Method Details

#typeObject



16
17
18
# File 'lib/cresip/serial.rb', line 16

def type
    @header.type
end