Exception: Aserto::AccessDenied
- Defined in:
- lib/aserto/errors.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#conditions ⇒ Object
readonly
Returns the value of attribute conditions.
-
#default_message ⇒ Object
writeonly
Sets the attribute default_message.
Instance Method Summary collapse
-
#initialize(message = nil, action = nil, conditions = nil) ⇒ AccessDenied
constructor
A new instance of AccessDenied.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(message = nil, action = nil, conditions = nil) ⇒ AccessDenied
Returns a new instance of AccessDenied.
12 13 14 15 16 17 18 |
# File 'lib/aserto/errors.rb', line 12 def initialize( = nil, action = nil, conditions = nil) = @action = action @conditions = conditions = I18n.t(:"unauthorized.default", default: "You are not authorized to access this page.") super() end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
9 10 11 |
# File 'lib/aserto/errors.rb', line 9 def action @action end |
#conditions ⇒ Object (readonly)
Returns the value of attribute conditions.
9 10 11 |
# File 'lib/aserto/errors.rb', line 9 def conditions @conditions end |
#default_message=(value) ⇒ Object (writeonly)
Sets the attribute default_message
10 11 12 |
# File 'lib/aserto/errors.rb', line 10 def (value) = value end |
Instance Method Details
#inspect ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/aserto/errors.rb', line 24 def inspect details = i[action conditions ].filter_map do |attribute| value = instance_variable_get :"@#{attribute}" "#{attribute}: #{value.inspect}" if value.present? end.join(", ") "#<#{self.class.name} #{details}>" end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/aserto/errors.rb', line 20 def to_s || end |