Class: MarshalParser::Formatters::Symbols::Table

Inherits:
Object
  • Object
show all
Defined in:
lib/marshal-parser/formatters/symbols/table.rb

Instance Method Summary collapse

Constructor Details

#initialize(symbols) ⇒ Table

Returns a new instance of Table.



7
8
9
# File 'lib/marshal-parser/formatters/symbols/table.rb', line 7

def initialize(symbols)
  @symbols = symbols
end

Instance Method Details

#stringObject



11
12
13
14
15
# File 'lib/marshal-parser/formatters/symbols/table.rb', line 11

def string
  @symbols.map.with_index do |symbol, i|
    "%-4d - :%s" % [i, symbol]
  end.join("\n")
end