Module: Babl::Operators::Static::DSL
- Included in:
- Template
- Defined in:
- lib/babl/operators/static.rb
Instance Method Summary collapse
-
#static(val) ⇒ Object
Create a static JSON value.
Instance Method Details
#static(val) ⇒ Object
Create a static JSON value
10 11 12 13 14 15 16 17 |
# File 'lib/babl/operators/static.rb', line 10 def static(val) case val when String, Numeric, NilClass, TrueClass, FalseClass then construct_terminal { Nodes::Static.new(val) } else call(Nodes::TerminalValue.instance.render_object(val)) end rescue Errors::RenderingError => exception raise Errors::InvalidTemplate, exception. end |