Module: Casting::MissingMethodClient

Defined in:
lib/casting/missing_method_client.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object (private)



20
21
22
23
24
25
26
# File 'lib/casting/missing_method_client.rb', line 20

def method_missing(meth, *args, &block)
  if !!method_delegate(meth)
    delegate(meth, method_delegate(meth), *args, &block)
  else
    super
  end
end

Instance Method Details

#cast_as(attendant) ⇒ Object



4
5
6
7
# File 'lib/casting/missing_method_client.rb', line 4

def cast_as(attendant)
  __delegates__.unshift(attendant)
  self
end

#uncastObject



9
10
11
12
# File 'lib/casting/missing_method_client.rb', line 9

def uncast
  __delegates__.shift
  self
end