Class: H2o::Template
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file, env = {}) ⇒ Template
constructor
A new instance of Template.
- #render(context = {}) ⇒ Object
Constructor Details
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
3 4 5 |
# File 'lib/h2o/template.rb', line 3 def context @context end |
Class Method Details
.load(file, env = {}) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/h2o/template.rb', line 22 def self.load file, env = {} unless H2o.loader env[:searchpath] ||= File.('../', file) H2o.loader = H2o::FileLoader.new(env[:searchpath]) end source = H2o.loader.read(file) parser = Parser.new(source, file, env) parser.parse end |