Class: Rampart::FailEvent
- Inherits:
-
Object
- Object
- Rampart::FailEvent
- Defined in:
- lib/rampart/events/fail_event.rb
Instance Method Summary collapse
- #halt? ⇒ Boolean
-
#initialize(message = "Not Authorized") ⇒ FailEvent
constructor
A new instance of FailEvent.
- #success? ⇒ Boolean
- #to_truple ⇒ Object
Constructor Details
#initialize(message = "Not Authorized") ⇒ FailEvent
Returns a new instance of FailEvent.
5 6 7 |
# File 'lib/rampart/events/fail_event.rb', line 5 def initialize(="Not Authorized") @message = end |
Instance Method Details
#halt? ⇒ Boolean
9 10 11 |
# File 'lib/rampart/events/fail_event.rb', line 9 def halt? true end |
#success? ⇒ Boolean
13 14 15 |
# File 'lib/rampart/events/fail_event.rb', line 13 def success? false end |
#to_truple ⇒ Object
17 18 19 20 21 22 |
# File 'lib/rampart/events/fail_event.rb', line 17 def to_truple response = Response.new response.write(@message) response.status = 401 response.finish end |