Exception: Regulator::NotAuthorizedError
- Defined in:
- lib/regulator.rb
Instance Attribute Summary collapse
-
#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 = {}) ⇒ NotAuthorizedError
constructor
A new instance of NotAuthorizedError.
Constructor Details
#initialize(options = {}) ⇒ NotAuthorizedError
Returns a new instance of NotAuthorizedError.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/regulator.rb', line 16 def initialize( = {}) if .is_a? String = else @query = [:query] @record = [:record] @policy = [:policy] @controller_or_namespace = [:controller_or_namespace] = .fetch(:message) { "not allowed to #{query} this #{record.inspect}" } end super() end |
Instance Attribute Details
#policy ⇒ Object (readonly)
Returns the value of attribute policy.
14 15 16 |
# File 'lib/regulator.rb', line 14 def policy @policy end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
14 15 16 |
# File 'lib/regulator.rb', line 14 def query @query end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
14 15 16 |
# File 'lib/regulator.rb', line 14 def record @record end |