class SpookAndPay::Transaction::InvalidActionError

An error thrown when attempting to perform an action that is not allowed given a transaction's status.

Public Class Methods

new(id, action, status) click to toggle source

@param String id @param Symbol action @param Symbol status

# File lib/spook_and_pay/transaction.rb, line 26
def initialize(id, action, status)
  @id     = id
  @action = action
  @status = status
end

Public Instance Methods

to_s() click to toggle source

Human readable message.

@return String

# File lib/spook_and_pay/transaction.rb, line 35
def to_s
  "Cannot perform the action '#{@action}' for transaction '#{@id}' while in status '#{@status}'"
end