Class: CrystalRuby::Template::Renderer
- Inherits:
-
Struct
- Object
- Struct
- CrystalRuby::Template::Renderer
- Defined in:
- lib/crystalruby/template.rb
Instance Attribute Summary collapse
-
#raw_value ⇒ Object
Returns the value of attribute raw_value.
Instance Method Summary collapse
Instance Attribute Details
#raw_value ⇒ Object
Returns the value of attribute raw_value
3 4 5 |
# File 'lib/crystalruby/template.rb', line 3 def raw_value @raw_value end |
Instance Method Details
#render(context) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/crystalruby/template.rb', line 5 def render(context) if context.kind_of?(::Hash) raw_value % context else ERB.new(raw_value, trim_mode: "%").result(context) end end |