Class: Babl::Nodes::Typed::String

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



31
32
33
34
35
36
37
38
# File 'lib/babl/nodes/typed.rb', line 31

def render(frame)
    value = frame.object
    return value if ::String === value
    return value.to_s if ::Symbol === value

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

#schemaObject



27
28
29
# File 'lib/babl/nodes/typed.rb', line 27

def schema
    Schema::Typed::STRING
end