Method: LazyString#initialize

Defined in:
lib/lazy_string.rb

#initialize(&block) ⇒ LazyString

Creates a new lazy string. The block argument will be saved for later use by #to_str. If no block argument is given, it will default to a block that returns an empty string.



18
19
20
# File 'lib/lazy_string.rb', line 18

def initialize(&block)
  @block = block || lambda { '' }
end