Class: Exerb::NameTable::Entry
- Inherits:
-
Object
- Object
- Exerb::NameTable::Entry
- Defined in:
- lib/exerb/name_table.rb
Overview
#
Defined Under Namespace
Classes: Header
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(id, name) ⇒ Entry
constructor
A new instance of Entry.
- #pack_header(pool) ⇒ Object
- #pack_pool ⇒ Object
Constructor Details
#initialize(id, name) ⇒ Entry
Returns a new instance of Entry.
81 82 83 84 |
# File 'lib/exerb/name_table.rb', line 81 def initialize(id, name) @id = id @name = name end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
86 87 88 |
# File 'lib/exerb/name_table.rb', line 86 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
86 87 88 |
# File 'lib/exerb/name_table.rb', line 86 def name @name end |
Instance Method Details
#pack_header(pool) ⇒ Object
88 89 90 91 92 93 94 |
# File 'lib/exerb/name_table.rb', line 88 def pack_header(pool) entry_header = Exerb::NameTable::Entry::Header.new entry_header.id = @id entry_header.offset_of_name = pool.size return entry_header.pack end |
#pack_pool ⇒ Object
96 97 98 |
# File 'lib/exerb/name_table.rb', line 96 def pack_pool return @name + "\0" end |