Exception: C2::AccessDenied
- Inherits:
-
StandardError
- Object
- StandardError
- C2::AccessDenied
- Defined in:
- lib/c2/exceptions.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#default_message ⇒ Object
writeonly
Sets the attribute default_message.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
Instance Method Summary collapse
-
#initialize(message = nil, subject = nil) ⇒ AccessDenied
constructor
A new instance of AccessDenied.
- #to_s ⇒ Object
Constructor Details
#initialize(message = nil, subject = nil) ⇒ AccessDenied
Returns a new instance of AccessDenied.
6 7 8 9 10 |
# File 'lib/c2/exceptions.rb', line 6 def initialize( = nil, subject = nil) @message = @subject = subject @default_message = "You are not authorized to access this page." end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
3 4 5 |
# File 'lib/c2/exceptions.rb', line 3 def action @action end |
#default_message=(value) ⇒ Object (writeonly)
Sets the attribute default_message
4 5 6 |
# File 'lib/c2/exceptions.rb', line 4 def (value) @default_message = value end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
3 4 5 |
# File 'lib/c2/exceptions.rb', line 3 def subject @subject end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/c2/exceptions.rb', line 12 def to_s @message || @default_message end |