Class: Helium::Console::Registry::Element::LazyStringEvaluator

Inherits:
Object
  • Object
show all
Defined in:
lib/helium/console/registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ LazyStringEvaluator

Returns a new instance of LazyStringEvaluator.



10
11
12
# File 'lib/helium/console/registry.rb', line 10

def initialize(&block)
  @lines = Enumerator.new { |y| block.(y) }
end

Instance Attribute Details

#linesObject (readonly)

Returns the value of attribute lines.



14
15
16
# File 'lib/helium/console/registry.rb', line 14

def lines
  @lines
end

Instance Method Details

#to_sObject



16
17
18
# File 'lib/helium/console/registry.rb', line 16

def to_s
  lines.to_a.join
end