Module: CanTango::ClassMethods

Included in:
CanTango
Defined in:
lib/cantango/class_methods.rb

Instance Method Summary collapse

Instance Method Details

#after_initializeObject

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

Returns:

  • (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_prepareObject

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