Module: CanTango::ClassMethods
- Included in:
- CanTango
- Defined in:
- lib/cantango/class_methods.rb
Instance Method Summary collapse
-
#after_initialize ⇒ Object
engine hook, run after all Rails initializations have been executed.
- #debug! ⇒ Object
- #debug? ⇒ Boolean
- #debug_off! ⇒ Object
-
#to_prepare ⇒ Object
Engine hook Run after the initializers are ran for all Railties (including the application itself), but before eager loading and the middleware stack is built.
Instance Method Details
#after_initialize ⇒ Object
engine hook, run after all Rails initializations have been executed
11 12 13 |
# File 'lib/cantango/class_methods.rb', line 11 def after_initialize config.hook(:after_initialize).call if config.hook(:after_initialize) end |
#debug! ⇒ Object
15 16 17 |
# File 'lib/cantango/class_methods.rb', line 15 def debug! config.debug.set :on end |
#debug? ⇒ Boolean
23 24 25 |
# File 'lib/cantango/class_methods.rb', line 23 def debug? config.debug.on? end |
#debug_off! ⇒ Object
19 20 21 |
# File 'lib/cantango/class_methods.rb', line 19 def debug_off! config.debug.set :off end |
#to_prepare ⇒ Object
Engine hook Run after the initializers are ran for all Railties (including the application itself), but before eager loading and the middleware stack is built. More importantly, will run upon every request in development, but only once (during boot-up) in production and test.
6 7 8 |
# File 'lib/cantango/class_methods.rb', line 6 def to_prepare config.hook(:to_prepare).call if config.hook(:to_prepare) end |