Class: Lox::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/lox/formatter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(objects) ⇒ Formatter

Returns a new instance of Formatter.



7
8
9
# File 'lib/lox/formatter.rb', line 7

def initialize(objects)
  @objects = objects
end

Instance Attribute Details

#objectsObject (readonly)

Returns the value of attribute objects.



5
6
7
# File 'lib/lox/formatter.rb', line 5

def objects
  @objects
end

Instance Method Details

#each(&block) ⇒ Object



11
12
13
# File 'lib/lox/formatter.rb', line 11

def each(&block)
  objects.lazy.map(&:inspect).each(&block)
end