Module: CanTango::ClassMethods

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

Class Method Summary collapse

Instance Method Summary collapse

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_initializeObject

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

Yields:

  • (conf)


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

Returns:

  • (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_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.



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