Class: Stencil::ViewDefinition
- Inherits:
-
Object
- Object
- Stencil::ViewDefinition
- Defined in:
- lib/stencil/view.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(render_class) ⇒ ViewDefinition
constructor
A new instance of ViewDefinition.
- #item(&block) ⇒ Object
- #list(&block) ⇒ Object
Constructor Details
#initialize(render_class) ⇒ ViewDefinition
Returns a new instance of ViewDefinition.
46 47 48 |
# File 'lib/stencil/view.rb', line 46 def initialize(render_class) @render_class = render_class end |
Class Method Details
.create_template(render_class, &block) ⇒ Object
41 42 43 44 |
# File 'lib/stencil/view.rb', line 41 def self.create_template(render_class, &block) definer = self.new(render_class) return definer.instance_eval(&block) end |
Instance Method Details
#item(&block) ⇒ Object
50 51 52 |
# File 'lib/stencil/view.rb', line 50 def item(&block) Capsule.new(@render_class, &block) end |
#list(&block) ⇒ Object
54 55 56 |
# File 'lib/stencil/view.rb', line 54 def list(&block) ListCapsule.new(@render_class, &block) end |