Class: Bemer::TemplateCatalog::Drawer
- Inherits:
-
Object
- Object
- Bemer::TemplateCatalog::Drawer
- Defined in:
- lib/bemer/template_catalog/drawer.rb
Instance Attribute Summary collapse
-
#cached ⇒ Object
(also: #cached?)
readonly
Returns the value of attribute cached.
Instance Method Summary collapse
- #compiled_templates ⇒ Object
-
#initialize(cached = false, &block) ⇒ Drawer
constructor
A new instance of Drawer.
Constructor Details
#initialize(cached = false, &block) ⇒ Drawer
Returns a new instance of Drawer.
10 11 12 13 |
# File 'lib/bemer/template_catalog/drawer.rb', line 10 def initialize(cached = false, &block) @block = block @cached = cached end |
Instance Attribute Details
#cached ⇒ Object (readonly) Also known as: cached?
Returns the value of attribute cached.
6 7 8 |
# File 'lib/bemer/template_catalog/drawer.rb', line 6 def cached @cached end |
Instance Method Details
#compiled_templates ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/bemer/template_catalog/drawer.rb', line 15 def compiled_templates @compiled_templates ||= begin new_templates = [] builder = Builders::TemplateList.new(new_templates) block.binding.receiver.capture(builder, &block) new_templates end end |