Class: Tarquinn::Handler
- Inherits:
-
Object
- Object
- Tarquinn::Handler
- Defined in:
- lib/tarquinn/handler.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#controller ⇒ Object
Returns the value of attribute controller.
Instance Method Summary collapse
-
#initialize(config, controller) ⇒ Handler
constructor
A new instance of Handler.
- #perform_redirect? ⇒ Boolean
- #redirect ⇒ Object
Constructor Details
#initialize(config, controller) ⇒ Handler
Returns a new instance of Handler.
6 7 8 9 |
# File 'lib/tarquinn/handler.rb', line 6 def initialize(config, controller) @config = config @controller = controller end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
2 3 4 |
# File 'lib/tarquinn/handler.rb', line 2 def config @config end |
#controller ⇒ Object
Returns the value of attribute controller.
2 3 4 |
# File 'lib/tarquinn/handler.rb', line 2 def controller @controller end |
Instance Method Details
#perform_redirect? ⇒ Boolean
11 12 13 14 |
# File 'lib/tarquinn/handler.rb', line 11 def perform_redirect? return @perform_redirect unless @perform_redirect.nil? @perform_redirect = is_redirect? end |
#redirect ⇒ Object
16 17 18 |
# File 'lib/tarquinn/handler.rb', line 16 def redirect controller.call(:redirect_to, redirect_path) end |