Class: Pakada::Render::Renderer
- Inherits:
-
Object
- Object
- Pakada::Render::Renderer
- Defined in:
- lib/pakada/render/renderer.rb
Instance Attribute Summary collapse
-
#engine ⇒ Object
readonly
Returns the value of attribute engine.
-
#locals ⇒ Object
readonly
Returns the value of attribute locals.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #each {|to_s| ... } ⇒ Object
-
#initialize(engine, locals = {}) ⇒ Renderer
constructor
A new instance of Renderer.
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#engine ⇒ Object (readonly)
Returns the value of attribute engine.
3 4 5 |
# File 'lib/pakada/render/renderer.rb', line 3 def engine @engine end |
#locals ⇒ Object (readonly)
Returns the value of attribute locals.
3 4 5 |
# File 'lib/pakada/render/renderer.rb', line 3 def locals @locals end |
Instance Method Details
#[](key) ⇒ Object
21 22 23 |
# File 'lib/pakada/render/renderer.rb', line 21 def [](key) locals[key] end |
#[]=(key, value) ⇒ Object
25 26 27 |
# File 'lib/pakada/render/renderer.rb', line 25 def []=(key, value) locals[key] = value end |
#each {|to_s| ... } ⇒ Object
17 18 19 |
# File 'lib/pakada/render/renderer.rb', line 17 def each yield to_s end |
#to_s ⇒ Object
10 11 12 13 14 15 |
# File 'lib/pakada/render/renderer.rb', line 10 def to_s @string ||= Pakada.instance(@instance.name) { context = Pakada.safety(Pakada::Render::RenderingContext).new engine.render context, locals } end |