Class: DecodedLump
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
Attributes inherited from Lump
Instance Method Summary collapse
- #add(i) ⇒ Object
-
#initialize(name) ⇒ DecodedLump
constructor
A new instance of DecodedLump.
- #write ⇒ Object
Constructor Details
#initialize(name) ⇒ DecodedLump
Returns a new instance of DecodedLump.
363 364 365 366 367 |
# File 'lib/ruby-doom.rb', line 363 def initialize(name) super(name) @items = [] @index = 0 end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
362 363 364 |
# File 'lib/ruby-doom.rb', line 362 def items @items end |
Instance Method Details
#add(i) ⇒ Object
368 369 370 371 372 373 |
# File 'lib/ruby-doom.rb', line 368 def add(i) i.id = @index @index += 1 @items << i return i end |
#write ⇒ Object
374 375 376 377 378 |
# File 'lib/ruby-doom.rb', line 374 def write out = [] @items.each {|i| out += i.write } out end |