Class: RPicSim::Label

Inherits:
Object
  • Object
show all
Defined in:
lib/rpicsim/label.rb

Overview

A very simple class that represents a label in firmware.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#addressInteger (readonly)

The address/value of the label from the firmware.

Returns:

  • (Integer)


12
13
14
# File 'lib/rpicsim/label.rb', line 12

def address
  @address
end

#nameSymbol (readonly)

The name of the label from the firmware.

Returns:

  • (Symbol)


8
9
10
# File 'lib/rpicsim/label.rb', line 8

def name
  @name
end

Instance Method Details

#to_iInteger

Returns the address of the label.

Returns:

  • (Integer)


24
25
26
# File 'lib/rpicsim/label.rb', line 24

def to_i
  address
end

#to_sString

Returns a nice string representation of the label.

Returns:

  • (String)


31
32
33
# File 'lib/rpicsim/label.rb', line 31

def to_s
  '<Label %s address=0x%x>' % [name, address]
end