Class: Helium::Console::Formatter::LazyStringEvaluator
- Inherits:
-
Object
- Object
- Helium::Console::Formatter::LazyStringEvaluator
- Defined in:
- lib/helium/console/formatter.rb
Instance Attribute Summary collapse
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
Instance Method Summary collapse
-
#initialize(&block) ⇒ LazyStringEvaluator
constructor
A new instance of LazyStringEvaluator.
- #to_s ⇒ Object
Constructor Details
#initialize(&block) ⇒ LazyStringEvaluator
Returns a new instance of LazyStringEvaluator.
13 14 15 |
# File 'lib/helium/console/formatter.rb', line 13 def initialize(&block) @lines = Enumerator.new { |y| block.(y) } end |
Instance Attribute Details
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
17 18 19 |
# File 'lib/helium/console/formatter.rb', line 17 def lines @lines end |
Instance Method Details
#to_s ⇒ Object
19 20 21 |
# File 'lib/helium/console/formatter.rb', line 19 def to_s lines.to_a.join end |