Class: Luoma::ExpressionDrop
- Defined in:
- lib/luoma/drops/expression.rb,
sig/luoma/drops/expression.rbs
Instance Attribute Summary collapse
-
#expr ⇒ LambdaExpr
readonly
Returns the value of attribute expr.
Instance Method Summary collapse
-
#initialize(expr) ⇒ ExpressionDrop
constructor
(LambdaExpr) -> void.
- #render(context) ⇒ Object
- #to_primitive(hint, context) ⇒ Object
Methods inherited from Drop
#contains?, #each, #eq?, #fetch, #gt?, #key?, #length, #lt?, #slice, #to_a, #to_s
Constructor Details
#initialize(expr) ⇒ ExpressionDrop
(LambdaExpr) -> void
8 9 10 11 |
# File 'lib/luoma/drops/expression.rb', line 8 def initialize(expr) super() @expr = expr end |
Instance Attribute Details
#expr ⇒ LambdaExpr (readonly)
Returns the value of attribute expr.
5 6 7 |
# File 'lib/luoma/drops/expression.rb', line 5 def expr @expr end |
Instance Method Details
#render(context) ⇒ Object
25 26 27 |
# File 'lib/luoma/drops/expression.rb', line 25 def render(context) @expr.to_s end |
#to_primitive(hint, context) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/luoma/drops/expression.rb', line 14 def to_primitive(hint, context) case hint when :numeric :nothing when :data, :string render(context) when :boolean true end end |