Class: Object

Inherits:
BasicObject
Defined in:
lib/tap/support/executable.rb

Overview

Tap extends Object with _method to generate executable methods that can be enqued by Tap::App and incorporated into workflows.

array = []
push_to_array = array._method(:push)

task = Tap::Task.new  
task.sequence(push_to_array)

task.enq(1).enq(2,3)
task.app.run

array   # => [[1],[2,3]]

Instance Method Summary collapse

Instance Method Details

#_method(method_name, app = Tap::App.instance) ⇒ Object

Initializes a Tap::Support::Executable using the object returned by Object#method(method_name).

Returns nil if Object#method returns nil.



303
304
305
306
# File 'lib/tap/support/executable.rb', line 303

def _method(method_name, app=Tap::App.instance)
  return nil unless m = method(method_name)
  Tap::Support::Executable.initialize(m, :call, app)
end