Exception: AuthorizedTransaction::TransactionUnauthorized
- Defined in:
- lib/authorized_transaction.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
-
#initialize(action, resource) ⇒ TransactionUnauthorized
constructor
A new instance of TransactionUnauthorized.
Constructor Details
#initialize(action, resource) ⇒ TransactionUnauthorized
Returns a new instance of TransactionUnauthorized.
19 20 21 22 23 |
# File 'lib/authorized_transaction.rb', line 19 def initialize(action, resource) self.action = action self.resource = resource super format('You are not allowed to perform %<action>s on %<klazz>s', action: action, klazz: resource.class.name) end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
17 18 19 |
# File 'lib/authorized_transaction.rb', line 17 def action @action end |
#resource ⇒ Object
Returns the value of attribute resource.
17 18 19 |
# File 'lib/authorized_transaction.rb', line 17 def resource @resource end |