module Roda::RodaPlugins::NamedTemplates::ClassMethods

  1. lib/roda/plugins/named_templates.rb

Methods

Public Instance

  1. freeze
  2. template

Public Instance methods

freeze()

Freeze the named templates so that there can be no thread safety issues at runtime.

[show source]
   # File lib/roda/plugins/named_templates.rb
65 def freeze
66   opts[:named_templates].freeze
67   super
68 end
template(name, options=nil, &block)

Store a new template block and options for the given template name.

[show source]
   # File lib/roda/plugins/named_templates.rb
71 def template(name, options=nil, &block)
72   opts[:named_templates][name.to_s] = [options, define_roda_method("named_templates_#{name}", 0, &block)].freeze
73   nil
74 end