Class: Indis::CStringEntity
- Defined in:
- lib/indis-core/cstring_entity.rb
Instance Attribute Summary collapse
-
#value ⇒ String
readonly
The value of entity.
Attributes inherited from Entity
Instance Method Summary collapse
-
#initialize(ofs, vmmap) ⇒ CStringEntity
constructor
A new instance of CStringEntity.
- #to_a ⇒ Object
- #to_s ⇒ Object
Methods inherited from Entity
Constructor Details
#initialize(ofs, vmmap) ⇒ CStringEntity
Returns a new instance of CStringEntity.
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/indis-core/cstring_entity.rb', line 28 def initialize(ofs, vmmap) super ofs @value = '' addr = ofs begin c = vmmap.byte_at(addr) @value += c.chr addr += 1 end while c != 0 @size = @value.length end |
Instance Attribute Details
#value ⇒ String (readonly)
Returns the value of entity.
24 25 26 |
# File 'lib/indis-core/cstring_entity.rb', line 24 def value @value end |
Instance Method Details
#to_a ⇒ Object
46 47 48 |
# File 'lib/indis-core/cstring_entity.rb', line 46 def to_a ['DCB', "\"#{@value[0...-1]}\",0"] end |
#to_s ⇒ Object
42 43 44 |
# File 'lib/indis-core/cstring_entity.rb', line 42 def to_s "DCB\t\"#{@value[0...-1]}\",0" end |