Module: OutputMode::BuilderDSL
- Included in:
- TLDR::Index, TLDR::Show
- Defined in:
- lib/output_mode/builder_dsl.rb
Instance Method Summary collapse
-
#build_output(**config) ⇒ Object
abstract
Provides the base method signature.
-
#output_callables ⇒ Object
The callable objects an ‘output` can be built from.
-
#register_callable(**config) { ... } ⇒ Object
abstract
Adds a new callable object to #output_callables.
Instance Method Details
#build_output(**config) ⇒ Object
This method is abstract.
Must be implemented by the main class/module
Provides the base method signature
47 48 49 |
# File 'lib/output_mode/builder_dsl.rb', line 47 def build_output(**config) raise NotImplementedError end |
#output_callables ⇒ Object
The callable objects an ‘output` can be built from
30 31 32 |
# File 'lib/output_mode/builder_dsl.rb', line 30 def output_callables @output_callables ||= Callables.new end |
#register_callable(**config) { ... } ⇒ Object
This method is abstract.
This maybe overridden to restrict the method signature
Adds a new callable object to #output_callables
38 39 40 41 42 |
# File 'lib/output_mode/builder_dsl.rb', line 38 def register_callable(**config, &b) Callable.new(**config, &b).tap do |c| output_callables << c end end |