Class: Rampart::RedirectEvent
- Inherits:
-
Object
- Object
- Rampart::RedirectEvent
- Defined in:
- lib/rampart/events/redirect_event.rb
Instance Method Summary collapse
- #halt? ⇒ Boolean
-
#initialize(url, status = 302) ⇒ RedirectEvent
constructor
A new instance of RedirectEvent.
- #success? ⇒ Boolean
- #to_truple ⇒ Object
Constructor Details
#initialize(url, status = 302) ⇒ RedirectEvent
Returns a new instance of RedirectEvent.
5 6 7 8 |
# File 'lib/rampart/events/redirect_event.rb', line 5 def initialize(url, status=302) @url = url @status = status end |
Instance Method Details
#halt? ⇒ Boolean
10 11 12 |
# File 'lib/rampart/events/redirect_event.rb', line 10 def halt? true end |
#success? ⇒ Boolean
14 15 16 |
# File 'lib/rampart/events/redirect_event.rb', line 14 def success? false end |
#to_truple ⇒ Object
18 19 20 21 22 23 |
# File 'lib/rampart/events/redirect_event.rb', line 18 def to_truple response = Response.new response.write("Redirecting to: #{@url}") response.redirect(@url, @status) response.finish end |