Class: FlexArray::ForEver
- Defined in:
- lib/flex_array/flex_array_forever.rb
Overview
A helper class that encapsulates the idea of looping without end!
Instance Method Summary collapse
-
#times(&block) ⇒ Object
Do something until false == true ;-).
-
#to_i ⇒ Object
Convert an eternity into an integer.
Instance Method Details
#times(&block) ⇒ Object
Do something until false == true ;-)
6 7 8 |
# File 'lib/flex_array/flex_array_forever.rb', line 6 def times(&block) loop {block.call} end |
#to_i ⇒ Object
Convert an eternity into an integer. ;-)
11 12 13 |
# File 'lib/flex_array/flex_array_forever.rb', line 11 def to_i nil end |