Class: As

Inherits:
BasicObject
Defined in:
lib/tesler/as.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(subject, ancestor) ⇒ As

Returns a new instance of As.



15
16
17
18
# File 'lib/tesler/as.rb', line 15

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



20
21
22
# File 'lib/tesler/as.rb', line 20

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