Exception: LinkedRails::Errors::Forbidden
- Inherits:
-
StandardError
- Object
- StandardError
- LinkedRails::Errors::Forbidden
- Defined in:
- lib/linked_rails/errors/forbidden.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#policy ⇒ Object
readonly
Returns the value of attribute policy.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
-
#initialize(**options) ⇒ String
constructor
The message.
Constructor Details
#initialize(**options) ⇒ String
Returns the message.
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/linked_rails/errors/forbidden.rb', line 14 def initialize(**) @query = .fetch(:query).to_s @record = [:record] @policy = [:policy] @action = @query[-1] == '?' ? @query[0..-2] : @query @message = [:message] raise StandardError if @query.blank? && @message.blank? super(@message || ) end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
6 7 8 |
# File 'lib/linked_rails/errors/forbidden.rb', line 6 def action @action end |
#policy ⇒ Object (readonly)
Returns the value of attribute policy.
6 7 8 |
# File 'lib/linked_rails/errors/forbidden.rb', line 6 def policy @policy end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
6 7 8 |
# File 'lib/linked_rails/errors/forbidden.rb', line 6 def query @query end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
6 7 8 |
# File 'lib/linked_rails/errors/forbidden.rb', line 6 def record @record end |