Class: Scribble::Template
Defined Under Namespace
Classes: Context
Instance Attribute Summary
Attributes inherited from Partial
Instance Method Summary collapse
-
#find_converter(from, to) ⇒ Object
Find converter.
-
#initialize(source, format: nil, loader: nil, converters: []) ⇒ Template
constructor
A new instance of Template.
-
#load(name, context) ⇒ Object
Load partial.
-
#render(variables: {}, registers: {}, format: nil) ⇒ Object
Render.
Methods inherited from Partial
Constructor Details
#initialize(source, format: nil, loader: nil, converters: []) ⇒ Template
Returns a new instance of Template.
4 5 6 7 |
# File 'lib/scribble/template.rb', line 4 def initialize source, format: nil, loader: nil, converters: [] super source, format: format @loader, @converters = loader, converters end |
Instance Method Details
#find_converter(from, to) ⇒ Object
Find converter
57 58 59 |
# File 'lib/scribble/template.rb', line 57 def find_converter from, to @converters.find { |converter| converter.from == from && converter.to == to } end |