Module: Hammock::MethodPatches

Defined in:
lib/hammock/monkey_patches/method.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

MixInto =
Method

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

:nodoc:



5
6
7
# File 'lib/hammock/monkey_patches/method.rb', line 5

def self.included base # :nodoc:
  base.send :extend, ClassMethods
end

Instance Method Details

#yield_until(method_name, &block) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/hammock/monkey_patches/method.rb', line 12

def yield_until method_name, &block
  loop do
    result = call
    break if result.send method_name
    yield result
  end
end