Class: Brandish::Processor::Inline
- Defined in:
- lib/brandish/processor/inline.rb
Overview
An inline-defined processor. This allows processors to be defined easily within a block. This is mostly used for configuration.
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.block!(*names) ⇒ void
Sets this processor as a block processor.
-
.command!(*names) ⇒ void
Sets this processor as a command processor.
-
.perform(&block) ⇒ void
Defines the
#perform
method with the given block.
Methods inherited from Base
#accept, #call, #initialize, #postprocess, #process_block, #process_command, #process_root, #process_text, register, #setup
Constructor Details
This class inherits a constructor from Brandish::Processor::Base
Class Method Details
.block!(*names) ⇒ void
This method returns an undefined value.
Sets this processor as a block processor. This include Block, and passes the given names to NameFilter::ClassMethods#name.
34 35 36 37 |
# File 'lib/brandish/processor/inline.rb', line 34 def self.block!(*names) include Block name(*names) end |
.command!(*names) ⇒ void
This method returns an undefined value.
Sets this processor as a command processor. This includes Command, and passes the given names to NameFilter::ClassMethods#name.
25 26 27 28 |
# File 'lib/brandish/processor/inline.rb', line 25 def self.command!(*names) include Command name(*names) end |
.perform(&block) ⇒ void
44 45 46 |
# File 'lib/brandish/processor/inline.rb', line 44 def self.perform(&block) define_method(:perform, &block) end |