Class: Smartdown::Parser::NodeTransform
- Inherits:
-
Parslet::Transform
- Object
- Parslet::Transform
- Smartdown::Parser::NodeTransform
- Defined in:
- lib/smartdown/parser/node_transform.rb
Instance Attribute Summary collapse
-
#data_module ⇒ Object
readonly
Returns the value of attribute data_module.
Instance Method Summary collapse
-
#call_on_match(bindings, block) ⇒ Object
TODO: Horrible monkey patching, should try to submit a PR to parselet to allow modification of bindings?.
-
#initialize(data_module = nil, &block) ⇒ NodeTransform
constructor
A new instance of NodeTransform.
Constructor Details
#initialize(data_module = nil, &block) ⇒ NodeTransform
Returns a new instance of NodeTransform.
34 35 36 37 38 |
# File 'lib/smartdown/parser/node_transform.rb', line 34 def initialize data_module=nil, &block super(&block) @data_module = data_module || {} end |
Instance Attribute Details
#data_module ⇒ Object (readonly)
Returns the value of attribute data_module.
32 33 34 |
# File 'lib/smartdown/parser/node_transform.rb', line 32 def data_module @data_module end |
Instance Method Details
#call_on_match(bindings, block) ⇒ Object
TODO: Horrible monkey patching, should try to submit a PR to parselet to allow modification of bindings?
42 43 44 45 |
# File 'lib/smartdown/parser/node_transform.rb', line 42 def call_on_match(bindings, block) bindings.merge! data_module super(bindings, block) end |