Module: CanTango::ClassMethods
- Included in:
- CanTango
- Defined in:
- lib/cantango/class_methods.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#after_initialize ⇒ Object
engine hook, run after all Rails initializations have been executed.
- #configure {|conf| ... } ⇒ Object (also: #config)
- #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.
Class Method Details
.extended(base) ⇒ Object
3 4 |
# File 'lib/cantango/class_methods.rb', line 3 def self.extended base end |
Instance Method Details
#after_initialize ⇒ Object
engine hook, run after all Rails initializations have been executed
21 22 23 |
# File 'lib/cantango/class_methods.rb', line 21 def after_initialize config.hook(:after_initialize).call if config.hook(:after_initialize) end |
#configure {|conf| ... } ⇒ Object Also known as: config
6 7 8 9 10 |
# File 'lib/cantango/class_methods.rb', line 6 def configure &block conf = CanTango::Config.instance yield conf if block conf end |
#debug! ⇒ Object
25 26 27 |
# File 'lib/cantango/class_methods.rb', line 25 def debug! config.debug.set :on end |
#debug? ⇒ Boolean
33 34 35 |
# File 'lib/cantango/class_methods.rb', line 33 def debug? config.debug.on? end |
#debug_off! ⇒ Object
29 30 31 |
# File 'lib/cantango/class_methods.rb', line 29 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.
16 17 18 |
# File 'lib/cantango/class_methods.rb', line 16 def to_prepare config.hook(:to_prepare).call if config.hook(:to_prepare) end |