Class: Controll::Flow::Action::Fallback

Inherits:
Base
  • Object
show all
Defined in:
lib/controll/flow/action/fallback.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#errors, #path

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#set_errors

Constructor Details

#initialize(controller, event = nil) ⇒ Fallback

Returns a new instance of Fallback.



5
6
7
8
# File 'lib/controll/flow/action/fallback.rb', line 5

def initialize controller, event = nil
  @controller = controller
  @event = event if event
end

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.



3
4
5
# File 'lib/controll/flow/action/fallback.rb', line 3

def controller
  @controller
end

#eventObject (readonly)

Returns the value of attribute event.



3
4
5
# File 'lib/controll/flow/action/fallback.rb', line 3

def event
  @event
end

Class Method Details

.action(controller, event = nil) ⇒ Object



20
21
22
# File 'lib/controll/flow/action/fallback.rb', line 20

def action controller, event = nil
  self.new controller, event
end

Instance Method Details

#performObject



10
11
12
13
# File 'lib/controll/flow/action/fallback.rb', line 10

def perform      
  error_check! if event
  controller.do_fallback self
end

#typeObject



15
16
17
# File 'lib/controll/flow/action/fallback.rb', line 15

def type
  :fallback
end