Module: Kernel

Defined in:
lib/core/kernel.rb

Overview

Kernel overloads

Instance Method Summary collapse

Instance Method Details

#as(klass_or_obj, &block) ⇒ Object



9
10
11
# File 'lib/core/kernel.rb', line 9

def as(klass_or_obj, &block)
  block.in_context(klass_or_obj).call
end

#wait(time = 10) ⇒ Object

Nice wait instead of sleep



6
7
8
# File 'lib/core/kernel.rb', line 6

def wait(time=10)
  sleep time.is_a?(String) ? eval(time) : time
end