Exception: AuthorizedTransaction::TransactionUnauthorized

Inherits:
Error
  • Object
show all
Defined in:
lib/authorized_transaction.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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