Exception: Trust::AccessDenied
- Inherits:
-
StandardError
- Object
- StandardError
- Trust::AccessDenied
- Defined in:
- lib/trust/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, action = nil, subject = nil) ⇒ AccessDenied
constructor
A new instance of AccessDenied.
- #to_s ⇒ Object
Constructor Details
#initialize(message = nil, action = nil, subject = nil) ⇒ AccessDenied
Returns a new instance of AccessDenied.
34 35 36 37 38 39 |
# File 'lib/trust/exceptions.rb', line 34 def initialize( = nil, action = nil, subject = nil) @message = @action = action @subject = subject @default_message = I18n.t(:"unauthorized.default", :default => "You are not authorized to access this page.") end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
31 32 33 |
# File 'lib/trust/exceptions.rb', line 31 def action @action end |
#default_message=(value) ⇒ Object (writeonly)
Sets the attribute default_message
32 33 34 |
# File 'lib/trust/exceptions.rb', line 32 def (value) @default_message = value end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
31 32 33 |
# File 'lib/trust/exceptions.rb', line 31 def subject @subject end |
Instance Method Details
#to_s ⇒ Object
41 42 43 |
# File 'lib/trust/exceptions.rb', line 41 def to_s @message || @default_message end |