Exception: GPSTool::InvalidChecksumError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/gpstool/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, sum) ⇒ InvalidChecksumError

Returns a new instance of InvalidChecksumError.


9
10
11
12
# File 'lib/gpstool/message.rb', line 9

def initialize(data, sum)
	@data = data
	@sum = sum
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data


14
15
16
# File 'lib/gpstool/message.rb', line 14

def data
  @data
end

#sumObject (readonly)

Returns the value of attribute sum


15
16
17
# File 'lib/gpstool/message.rb', line 15

def sum
  @sum
end

Instance Method Details

#to_sObject


17
18
19
# File 'lib/gpstool/message.rb', line 17

def to_s
	"Invalid Checksum: #{data.dump}*#{sum}, should be #{Message.checksum_hex(data)}"
end