Module: UltraMarathon::Contexticution

Included in:
Callbacks, UltraMarathon::Callbacks::ClassMethods
Defined in:
lib/ultra_marathon/contexticution.rb

Instance Method Summary collapse

Instance Method Details

#contexticute(object, args = [], context = self) ⇒ Object

Parameters:

  • object (Symbol, String, Proc)

    a symbol representing a method name, a string to be eval’d, or a proc to be called in the given context

  • args (Array) (defaults to: [])

    arguments to be passed to object

  • context (Object) (defaults to: self)

    the context in which to evaluate object. Defaults to self



11
12
13
14
# File 'lib/ultra_marathon/contexticution.rb', line 11

def contexticute(object, args=[], context=self)
  bound_proc = bind_to_context(object, context)
  evaluate_block_with_arguments(bound_proc, args)
end