The Self class allows one to get access the hidden Object/Kernel methods. It is essentially a specialized Functor which binds an Object/Kernel method to the current object for the current call.
Methods
Public Class methods
[ show source ]
# File lib/facets/more/basicobject.rb, line 77 def initialize(obj, as=nil) @obj = obj @as = as || ::Object end
Public Instance methods
[ show source ]
# File lib/facets/more/basicobject.rb, line 81 def method_missing(meth, *args, &blk) @as.instance_method(meth).bind(@obj).call(*args, &blk) end