Exception: SelfControl::AccessDenied
- Defined in:
- lib/self-control/exceptions.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#default_message ⇒ Object
writeonly
Sets the attribute default_message.
-
#step ⇒ Object
readonly
Returns the value of attribute step.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
Instance Method Summary collapse
-
#initialize(message = nil, subject = nil, step = nil, action = nil) ⇒ AccessDenied
constructor
A new instance of AccessDenied.
- #to_s ⇒ Object
Constructor Details
#initialize(message = nil, subject = nil, step = nil, action = nil) ⇒ AccessDenied
Returns a new instance of AccessDenied.
10 11 12 13 14 15 16 |
# File 'lib/self-control/exceptions.rb', line 10 def initialize(=nil, subject=nil, step=nil, action=nil) @message = @subject = subject @step = step @action = action @default_message = "You are not authorized to access this step." end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
7 8 9 |
# File 'lib/self-control/exceptions.rb', line 7 def action @action end |
#default_message=(value) ⇒ Object (writeonly)
Sets the attribute default_message
8 9 10 |
# File 'lib/self-control/exceptions.rb', line 8 def (value) @default_message = value end |
#step ⇒ Object (readonly)
Returns the value of attribute step.
7 8 9 |
# File 'lib/self-control/exceptions.rb', line 7 def step @step end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
7 8 9 |
# File 'lib/self-control/exceptions.rb', line 7 def subject @subject end |
Instance Method Details
#to_s ⇒ Object
18 19 20 |
# File 'lib/self-control/exceptions.rb', line 18 def to_s @message || @default_message end |