Class: Babl::Nodes::Typed::String
- Inherits:
-
Base
- Object
- Base
- Babl::Nodes::Typed::String
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
31
32
33
34
35
36
37
38
|
# File 'lib/babl/nodes/typed.rb', line 31
def render(ctx)
value = ctx.object
return value if ::String === value
return value.to_s if ::Symbol === value
raise Errors::RenderingError,
"Expected a string, got #{value}\n#{ctx.formatted_stack}"
end
|
27
28
29
|
# File 'lib/babl/nodes/typed.rb', line 27
def schema
Schema::Typed::STRING
end
|