Class: SelectionExpression
- Inherits:
-
Object
- Object
- SelectionExpression
- Defined in:
- lib/thymeleaf/dialects/default/parsers/selection.rb
Class Method Summary collapse
-
.parse(context, expr, obj_var, **args) ⇒ Object
Parse asterisk *… syntax (object selection).
Class Method Details
.parse(context, expr, obj_var, **args) ⇒ Object
Parse asterisk *… syntax (object selection)
5 6 7 8 9 10 11 12 13 |
# File 'lib/thymeleaf/dialects/default/parsers/selection.rb', line 5 def self.parse(context, expr, obj_var, **args) expr.gsub(/(\*{.+?})/) do |match| if obj_var.nil? "${#{match[2..-2]}}" else ContextEvaluator.new(ContextHolder.new obj_var).evaluate(match[2..-2]) end end end |