Class: Lox::Formatter
- Inherits:
-
Object
- Object
- Lox::Formatter
- Defined in:
- lib/lox/formatter.rb
Instance Attribute Summary collapse
-
#objects ⇒ Object
readonly
Returns the value of attribute objects.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(objects) ⇒ Formatter
constructor
A new instance of Formatter.
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
#objects ⇒ Object (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 |