Class: Midge::Config
- Inherits:
-
Object
- Object
- Midge::Config
- Defined in:
- lib/midge/config.rb
Instance Attribute Summary collapse
-
#js_null_processor ⇒ Object
readonly
Returns the value of attribute js_null_processor.
Instance Method Summary collapse
- #configure!(sprockets = Sprockets) ⇒ Object
-
#initialize ⇒ Config
constructor
Private API ##.
- #js_processor(extension, namespace = Rails.application.class.parent_name) ⇒ Object
-
#jst_processor(extension, namespace = Rails.application.class.parent_name) ⇒ Object
Public API ##.
- #set(property, value) ⇒ Object
Constructor Details
#initialize ⇒ Config
Private API ##
10 11 12 13 |
# File 'lib/midge/config.rb', line 10 def initialize @processors = [] set :js_null_processor, true end |
Instance Attribute Details
#js_null_processor ⇒ Object (readonly)
Returns the value of attribute js_null_processor.
6 7 8 |
# File 'lib/midge/config.rb', line 6 def js_null_processor @js_null_processor end |
Instance Method Details
#configure!(sprockets = Sprockets) ⇒ Object
15 16 17 18 19 |
# File 'lib/midge/config.rb', line 15 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
27 28 29 |
# File 'lib/midge/config.rb', line 27 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
Public API ##
23 24 25 |
# File 'lib/midge/config.rb', line 23 def jst_processor(extension, namespace=Rails.application.class.parent_name) @processors << [::Midge::JstProcessor, extension, namespace] end |
#set(property, value) ⇒ Object
31 32 33 |
# File 'lib/midge/config.rb', line 31 def set(property, value) instance_variable_set("@#{property}", value) end |