Module: Kernel

Defined in:
lib/kleisli/blank.rb

Overview

Since Ruby is very dynamic, methods added to the ancestors of Blank after Blank is defined will show up in the list of available Blank methods. We handle this by defining a hook in the Object and Kernel classes that will hide any method defined after Blank has been loaded.

Class Method Summary collapse

Class Method Details

.blank_slate_method_addedObject



60
# File 'lib/kleisli/blank.rb', line 60

alias_method :blank_slate_method_added, :method_added

.method_added(name) ⇒ Object

Detect method additions to Kernel and remove them in the Blank class.



64
65
66
67
68
69
# File 'lib/kleisli/blank.rb', line 64

def method_added(name)
  result = blank_slate_method_added(name)
  return result if self != Kernel
  Blank.hide(name)
  result
end