Class: ZAssets::Plugins::Handlebars::Registrant
- Inherits:
-
Object
- Object
- ZAssets::Plugins::Handlebars::Registrant
- Defined in:
- lib/zassets/plugins/handlebars/registrant.rb
Instance Method Summary collapse
-
#initialize(config) ⇒ Registrant
constructor
A new instance of Registrant.
- #register ⇒ Object
Constructor Details
#initialize(config) ⇒ Registrant
Returns a new instance of Registrant.
5 6 7 8 9 10 |
# File 'lib/zassets/plugins/handlebars/registrant.rb', line 5 def initialize(config) @config = config @plugin_config = @config[:plugins] .find { |e| e[:name].to_sym == :handlebars } .reject { |k, v| k == :name } end |
Instance Method Details
#register ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/zassets/plugins/handlebars/registrant.rb', line 12 def register require 'handlebars_assets' HandlebarsAssets::Config.template_namespace = 'JST' @plugin_config.each do |k, v| HandlebarsAssets::Config.send "#{k}=".to_sym, v end @config[:paths] << HandlebarsAssets.path end |