Class: Sanford::TemplateEngine
- Inherits:
-
Object
- Object
- Sanford::TemplateEngine
- Defined in:
- lib/sanford/template_engine.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
-
#source_path ⇒ Object
readonly
Returns the value of attribute source_path.
Instance Method Summary collapse
- #==(other_engine) ⇒ Object
-
#initialize(opts = nil) ⇒ TemplateEngine
constructor
A new instance of TemplateEngine.
- #partial(name, locals) ⇒ Object
- #render(name, service_handler, locals) ⇒ Object
Constructor Details
#initialize(opts = nil) ⇒ TemplateEngine
Returns a new instance of TemplateEngine.
10 11 12 13 14 |
# File 'lib/sanford/template_engine.rb', line 10 def initialize(opts = nil) @opts = opts || {} @source_path = Pathname.new(@opts['source_path'].to_s) @logger = @opts['logger'] || Sanford::NullLogger.new end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
8 9 10 |
# File 'lib/sanford/template_engine.rb', line 8 def logger @logger end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
8 9 10 |
# File 'lib/sanford/template_engine.rb', line 8 def opts @opts end |
#source_path ⇒ Object (readonly)
Returns the value of attribute source_path.
8 9 10 |
# File 'lib/sanford/template_engine.rb', line 8 def source_path @source_path end |
Instance Method Details
#==(other_engine) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/sanford/template_engine.rb', line 24 def ==(other_engine) if other_engine.kind_of?(TemplateEngine) self.source_path == other_engine.source_path && self.opts == other_engine.opts else super end end |
#partial(name, locals) ⇒ Object
20 21 22 |
# File 'lib/sanford/template_engine.rb', line 20 def partial(name, locals) raise NotImplementedError end |
#render(name, service_handler, locals) ⇒ Object
16 17 18 |
# File 'lib/sanford/template_engine.rb', line 16 def render(name, service_handler, locals) raise NotImplementedError end |