Class: Controll::Enabler::PathHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/controll/enabler/path_handler.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller, type) ⇒ PathHandler

Returns a new instance of PathHandler.



5
6
7
# File 'lib/controll/enabler/path_handler.rb', line 5

def initialize controller, type
  @controller, @type = [controller, type]
end

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.



3
4
5
# File 'lib/controll/enabler/path_handler.rb', line 3

def controller
  @controller
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/controll/enabler/path_handler.rb', line 3

def options
  @options
end

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/controll/enabler/path_handler.rb', line 3

def path
  @path
end

#typeObject (readonly) Also known as: control_action

Returns the value of attribute type.



3
4
5
# File 'lib/controll/enabler/path_handler.rb', line 3

def type
  @type
end

Class Method Details

.redirecter(controller, map) ⇒ Object



13
14
15
# File 'lib/controll/enabler/path_handler.rb', line 13

def self.redirecter controller, map
  self.new controller, map, :redirect
end

.renderer(controller, map) ⇒ Object



9
10
11
# File 'lib/controll/enabler/path_handler.rb', line 9

def self.renderer controller, map
  self.new controller, map, :render
end

Instance Method Details

#execute(*args) ⇒ Object



17
18
19
20
21
# File 'lib/controll/enabler/path_handler.rb', line 17

def execute *args
  extract! *args
  process_notifications
  path ? handle_path : fallback
end