Class: Probject::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/probject/proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(probject, invocation_type) ⇒ Proxy



4
5
6
7
# File 'lib/probject/proxy.rb', line 4

def initialize(probject, invocation_type)
  @probject = probject
  @invocation_type = invocation_type
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



9
10
11
12
# File 'lib/probject/proxy.rb', line 9

def method_missing(name, *args, &block)
  method = @probject.method("____#{name}_#{@invocation_type}")
  method.call(*args, &block)
end