Class: ZAssets::Plugins::Ember::Registrant
- Inherits:
-
Object
- Object
- ZAssets::Plugins::Ember::Registrant
- Defined in:
- lib/zassets/plugins/ember/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 11 12 13 14 15 |
# File 'lib/zassets/plugins/ember/registrant.rb', line 5 def initialize(config) @config = config @plugin_config = case @config[:plugins] when Hash @config[:plugins] .find { |e| e[:name].to_sym == :handlebars } .reject { |k, v| k == :name } else {} end end |
Instance Method Details
#register ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/zassets/plugins/ember/registrant.rb', line 17 def register require 'ember/handlebars/template' ::Ember::::Template.configure do |config| @plugin_config.each { |k, v| config.send :"#{k}=", v } end @config[:engines][:hbs] = ::Ember::::Template end |