Class: Babl::Nodes::Typed::Boolean

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(ctx) ⇒ Object



75
76
77
78
79
80
81
# File 'lib/babl/nodes/typed.rb', line 75

def render(ctx)
    value = ctx.object
    return value if true == value || false == value

    raise Errors::RenderingError,
        "Expected a boolean, got #{value}\n#{ctx.formatted_stack}"
end

#schemaObject



71
72
73
# File 'lib/babl/nodes/typed.rb', line 71

def schema
    Schema::Typed::BOOLEAN
end