Class: Stencil::Capsule
- Inherits:
-
Object
- Object
- Stencil::Capsule
- Defined in:
- lib/stencil/view.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Instance Method Summary collapse
-
#initialize(render_class, &block) ⇒ Capsule
constructor
A new instance of Capsule.
- #render(data) ⇒ Object
Constructor Details
#initialize(render_class, &block) ⇒ Capsule
Returns a new instance of Capsule.
60 61 62 63 |
# File 'lib/stencil/view.rb', line 60 def initialize(render_class, &block) @render_class = render_class @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
64 65 66 |
# File 'lib/stencil/view.rb', line 64 def block @block end |
Instance Method Details
#render(data) ⇒ Object
66 67 68 |
# File 'lib/stencil/view.rb', line 66 def render(data) @render_class.new(data, self).go end |