Class: Midge::Config
- Inherits:
-
Object
- Object
- Midge::Config
- Defined in:
- lib/midge/config.rb
Instance Attribute Summary collapse
-
#js_null_processor_enabled ⇒ Object
readonly
Returns the value of attribute js_null_processor_enabled.
Instance Method Summary collapse
- #configure!(sprockets = Sprockets) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #js_processor(extension, namespace = Rails.application.class.parent_name) ⇒ Object
- #jst_processor(extension, namespace = Rails.application.class.parent_name) ⇒ Object
- #set_js_null_processor_enabled(value) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
8 9 10 11 |
# File 'lib/midge/config.rb', line 8 def initialize @processors = [] set_js_null_processor_enabled(true) end |
Instance Attribute Details
#js_null_processor_enabled ⇒ Object (readonly)
Returns the value of attribute js_null_processor_enabled.
6 7 8 |
# File 'lib/midge/config.rb', line 6 def js_null_processor_enabled @js_null_processor_enabled end |
Instance Method Details
#configure!(sprockets = Sprockets) ⇒ Object
25 26 27 28 29 |
# File 'lib/midge/config.rb', line 25 def configure!(sprockets=Sprockets) @processors.each do |base_klass, extension, namespace| sprockets.register_engine extension, create_processer(base_klass, namespace) end end |
#js_processor(extension, namespace = Rails.application.class.parent_name) ⇒ Object
17 18 19 |
# File 'lib/midge/config.rb', line 17 def js_processor(extension, namespace=Rails.application.class.parent_name) @processors << [::Midge::JavascriptProcessor, extension, namespace] end |
#jst_processor(extension, namespace = Rails.application.class.parent_name) ⇒ Object
13 14 15 |
# File 'lib/midge/config.rb', line 13 def jst_processor(extension, namespace=Rails.application.class.parent_name) @processors << [::Midge::JstProcessor, extension, namespace] end |
#set_js_null_processor_enabled(value) ⇒ Object
21 22 23 |
# File 'lib/midge/config.rb', line 21 def set_js_null_processor_enabled(value) @js_null_processor = value end |