Class: Babl::Nodes::Typed::Number
Instance Method Summary collapse
Methods inherited from Base
#dependencies, #optimize, #pinned_dependencies
Instance Method Details
#render(frame) ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'lib/babl/nodes/typed.rb', line 60 def render(frame) value = frame.object return value if ::Integer === value return value.to_f if ::Numeric === value raise Errors::RenderingError, "Expected a number, got #{value.inspect}\n#{frame.formatted_stack}" end |