Module: OutputMode::BuilderDSL

Included in:
TLDR::Index, TLDR::Show
Defined in:
lib/output_mode/builder_dsl.rb

Instance Method Summary collapse

Instance Method Details

#build_output(**config) ⇒ Object

This method is abstract.

Must be implemented by the main class/module

Provides the base method signature

Returns:

  • OutputMode::Output The newly created output

Raises:

  • (NotImplementedError)


47
48
49
# File 'lib/output_mode/builder_dsl.rb', line 47

def build_output(**config)
  raise NotImplementedError
end

#output_callablesObject

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

Parameters:

Yields:



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