Module: Executable::Dispatch
- Defined in:
- lib/executable/dispatch.rb
Overview
Variation of Executable which provides basic compatibility with previous versions of Executable. It provides a call method that automatically dispatches to public methods.
Among other uses, Dispatch can be useful for dropping into any class as a quick and dirty way to work with it on the command line.
Class Method Summary collapse
-
.included(base) ⇒ Object
When Dispatchable is included into a class, the class is also extended by ‘Executable::Domain`.
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
When Dispatchable is included into a class, the class is also extended by ‘Executable::Domain`.
18 19 20 |
# File 'lib/executable/dispatch.rb', line 18 def self.included(base) base.extend Domain end |
Instance Method Details
#call(name, *args) ⇒ Object
22 23 24 |
# File 'lib/executable/dispatch.rb', line 22 def call(name, *args) public_method(name).call(*args) end |