Class: Exerb::NameTable::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/exerb/name_table.rb

Overview

#

Defined Under Namespace

Classes: Header

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject (readonly)

Returns the value of attribute id



86
87
88
# File 'lib/exerb/name_table.rb', line 86

def id
  @id
end

#nameObject (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_poolObject



96
97
98
# File 'lib/exerb/name_table.rb', line 96

def pack_pool
  return @name + "\0"
end