Class: Karafka::Web::Ui::Controllers::Responses::Redirect
- Inherits:
-
Object
- Object
- Karafka::Web::Ui::Controllers::Responses::Redirect
- Defined in:
- lib/karafka/web/ui/controllers/responses/redirect.rb
Overview
Representation of a redirect response with optional flash messages
Instance Attribute Summary collapse
-
#flashes ⇒ Object
readonly
Returns the value of attribute flashes.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#back? ⇒ Boolean
Are we going back via referer and not explicit path.
-
#initialize(path = :back, flashes = {}) ⇒ Redirect
constructor
A new instance of Redirect.
Constructor Details
#initialize(path = :back, flashes = {}) ⇒ Redirect
Returns a new instance of Redirect.
15 16 17 18 |
# File 'lib/karafka/web/ui/controllers/responses/redirect.rb', line 15 def initialize(path = :back, flashes = {}) @path = path @flashes = flashes end |
Instance Attribute Details
#flashes ⇒ Object (readonly)
Returns the value of attribute flashes.
10 11 12 |
# File 'lib/karafka/web/ui/controllers/responses/redirect.rb', line 10 def flashes @flashes end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
10 11 12 |
# File 'lib/karafka/web/ui/controllers/responses/redirect.rb', line 10 def path @path end |
Instance Method Details
#back? ⇒ Boolean
Returns are we going back via referer and not explicit path.
21 22 23 |
# File 'lib/karafka/web/ui/controllers/responses/redirect.rb', line 21 def back? @path == :back end |