Module: Kernel
- Defined in:
- lib/hpricot/blankslate.rb
Overview
Since Ruby is very dynamic, methods added to the ancestors of BlankSlate after BlankSlate is defined will show up in the list of available BlankSlate methods. We handle this by defining a hook in the Object and Kernel classes that will hide any defined
Class Method Summary collapse
- .hpricot_slate_method_added ⇒ Object
-
.method_added(name) ⇒ Object
Detect method additions to Kernel and remove them in the BlankSlate class.
Class Method Details
.hpricot_slate_method_added ⇒ Object
39 |
# File 'lib/hpricot/blankslate.rb', line 39 alias_method :hpricot_slate_method_added, :method_added |
.method_added(name) ⇒ Object
Detect method additions to Kernel and remove them in the BlankSlate class.
43 44 45 46 47 |
# File 'lib/hpricot/blankslate.rb', line 43 def method_added(name) hpricot_slate_method_added(name) return if self != Kernel Hpricot::BlankSlate.hide(name) end |