Class: IntelHex::Record::Data

Inherits:
IntelHex::Record show all
Defined in:
lib/intel_hex/record/data.rb

Instance Attribute Summary

Attributes inherited from IntelHex::Record

#checksum, #data, #length, #line, #offset

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from IntelHex::Record

#calculate_checksum, data, #each_byte_with_address, ela, eof, esa, inherited, #initialize, parse, #recalculate_checksum, register_type, sla, ssa, #to_ascii, #to_h, #to_s, #type_data_length, #type_id, #type_name, #valid?, #validate, #validate_checksum, #validate_data, #validate_length, #validate_offset

Constructor Details

This class inherits a constructor from IntelHex::Record

Class Method Details

.type_data_lengthObject



14
15
16
# File 'lib/intel_hex/record/data.rb', line 14

def self.type_data_length
  (1..255)
end

.type_idObject



6
7
8
# File 'lib/intel_hex/record/data.rb', line 6

def self.type_id
  0
end

.type_nameObject



10
11
12
# File 'lib/intel_hex/record/data.rb', line 10

def self.type_name
  :data
end

Instance Method Details

#valueObject



18
19
20
# File 'lib/intel_hex/record/data.rb', line 18

def value
  data
end

#value_sObject



22
23
24
25
26
# File 'lib/intel_hex/record/data.rb', line 22

def value_s
  data_string = data.map { |b| format("%02x", b) }.join(" ")

  "[#{data_string}]"
end