Class: As

Inherits:
Object show all
Defined in:
lib/core/facets/kernel/super.rb

Overview

Support class for Kernel#as.

Instance Method Summary collapse

Constructor Details

#initialize(subject, ancestor) ⇒ As

Returns a new instance of As.



150
151
152
153
# File 'lib/core/facets/kernel/super.rb', line 150

def initialize(subject, ancestor)
  @subject = subject
  @ancestor = ancestor
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &blk) ⇒ Object



155
156
157
# File 'lib/core/facets/kernel/super.rb', line 155

def method_missing(sym, *args, &blk)
  @ancestor.instance_method(sym).bind(@subject).call(*args,&blk)
end