Class: Sablon::Statement::Insertion
- Inherits:
-
Struct
- Object
- Struct
- Sablon::Statement::Insertion
- Defined in:
- lib/sablon/operations.rb
Instance Attribute Summary collapse
-
#expr ⇒ Object
Returns the value of attribute expr.
-
#field ⇒ Object
Returns the value of attribute field.
Instance Method Summary collapse
Instance Attribute Details
#expr ⇒ Object
Returns the value of attribute expr
4 5 6 |
# File 'lib/sablon/operations.rb', line 4 def expr @expr end |
#field ⇒ Object
Returns the value of attribute field
4 5 6 |
# File 'lib/sablon/operations.rb', line 4 def field @field end |
Instance Method Details
#evaluate(env) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/sablon/operations.rb', line 5 def evaluate(env) if content = expr.evaluate(env.context) field.replace(Sablon::Content.wrap(content), env) else field.remove end end |