Module: Kernel
- Defined in:
- lib/therefore/kernel_patch.rb
Instance Method Summary collapse
Instance Method Details
#otherwise(*_args) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/therefore/kernel_patch.rb', line 12 def otherwise *_args if block_given? self else Enumerator.new do # Empty enumerator end end end |
#therefore ⇒ Object
2 3 4 5 6 7 8 9 10 |
# File 'lib/therefore/kernel_patch.rb', line 2 def therefore if block_given? yield self else Enumerator.new do |yielder| yielder << self end end end |