Module: Roda::RodaPlugins::NamedTemplates::ClassMethods
- Defined in:
- lib/roda/plugins/named_templates.rb
Instance Method Summary collapse
-
#freeze ⇒ Object
Freeze the named templates so that there can be no thread safety issues at runtime.
-
#template(name, options = nil, &block) ⇒ Object
Store a new template block and options for the given template name.
Instance Method Details
#freeze ⇒ Object
Freeze the named templates so that there can be no thread safety issues at runtime.
65 66 67 68 |
# File 'lib/roda/plugins/named_templates.rb', line 65 def freeze opts[:named_templates].freeze super end |
#template(name, options = nil, &block) ⇒ Object
Store a new template block and options for the given template name.
71 72 73 74 |
# File 'lib/roda/plugins/named_templates.rb', line 71 def template(name, =nil, &block) opts[:named_templates][name.to_s] = [, define_roda_method("named_templates_#{name}", 0, &block)].freeze nil end |