Class: Sablon::Processor::Document::InsertionHandler
- Inherits:
-
FieldHandler
- Object
- FieldHandler
- Sablon::Processor::Document::InsertionHandler
- Defined in:
- lib/sablon/processor/document/field_handlers.rb
Overview
Handles simple text insertion
Instance Method Summary collapse
- #build_statement(_constructor, field, options = {}) ⇒ Object
-
#initialize ⇒ InsertionHandler
constructor
A new instance of InsertionHandler.
Methods inherited from FieldHandler
Constructor Details
#initialize ⇒ InsertionHandler
Returns a new instance of InsertionHandler.
32 33 34 |
# File 'lib/sablon/processor/document/field_handlers.rb', line 32 def initialize super(/^=/) end |
Instance Method Details
#build_statement(_constructor, field, options = {}) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/sablon/processor/document/field_handlers.rb', line 36 def build_statement(_constructor, field, = {}) return unless [:allow_insertion] # expr = Expression.parse(field.expression.gsub(/^=/, '')) Statement::Insertion.new(expr, field) end |