Class: Sablon::Processor::Document::ImageHandler
- Inherits:
-
FieldHandler
- Object
- FieldHandler
- Sablon::Processor::Document::ImageHandler
- Defined in:
- lib/sablon/processor/document/field_handlers.rb
Overview
Handles image insertion fields
Instance Method Summary collapse
- #build_statement(constructor, field, _options = {}) ⇒ Object
-
#initialize ⇒ ImageHandler
constructor
A new instance of ImageHandler.
Methods inherited from FieldHandler
Constructor Details
#initialize ⇒ ImageHandler
Returns a new instance of ImageHandler.
93 94 95 |
# File 'lib/sablon/processor/document/field_handlers.rb', line 93 def initialize super(/^@([^ ]+):start/) end |
Instance Method Details
#build_statement(constructor, field, _options = {}) ⇒ Object
97 98 99 100 101 |
# File 'lib/sablon/processor/document/field_handlers.rb', line 97 def build_statement(constructor, field, = {}) expr_name = field.expression.match(@pattern).to_a[1] block = constructor.consume_block("@#{expr_name}:end") Statement::Image.new(Expression.parse(expr_name), block) end |