Class: Surrounded::Context::Negotiator

Inherits:
Object
  • Object
show all
Defined in:
lib/surrounded/context/negotiator.rb

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



18
19
20
21
22
23
24
25
# File 'lib/surrounded/context/negotiator.rb', line 18

def method_missing(meth, *args, &block)
  if @behaviors.instance_methods.include?(meth)
    the_method = @behaviors.instance_method(meth)
    the_method.bind(@object).call(*args, &block)
  else
    @object.send(meth, *args, &block)
  end
end