Class: Babl::Nodes::Typed::Integer

Inherits:
Base
  • Object
show all
Defined in:
lib/babl/nodes/typed.rb

Instance Method Summary collapse

Methods inherited from Base

#dependencies, #optimize, #pinned_dependencies

Instance Method Details

#render(frame) ⇒ Object



46
47
48
49
50
51
52
# File 'lib/babl/nodes/typed.rb', line 46

def render(frame)
    value = frame.object
    return value if ::Integer === value

    raise Errors::RenderingError,
        "Expected an integer, got #{value.inspect}\n#{frame.formatted_stack}"
end

#schemaObject



42
43
44
# File 'lib/babl/nodes/typed.rb', line 42

def schema
    Schema::Typed::INTEGER
end