Module: Motorhead::Engine::ClassMethods

Defined in:
lib/motorhead/engine.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#on_errorObject

Returns the value of attribute on_error.



8
9
10
# File 'lib/motorhead/engine.rb', line 8

def on_error
  @on_error
end

Instance Method Details

#active?(controller) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/motorhead/engine.rb', line 14

def active?(controller)
  controller.instance_eval(&@active_if)
end

#active_if(&block) ⇒ Object



10
11
12
# File 'lib/motorhead/engine.rb', line 10

def active_if(&block)
  @active_if = block
end

#mount_at(path = nil) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/motorhead/engine.rb', line 18

def mount_at(path = nil)
  if path
    @mount_at = path
  else
    defined?(@mount_at) && @mount_at
  end
end