Class: Ashmont::Errors

Inherits:
Object
  • Object
show all
Defined in:
lib/ashmont/errors.rb

Constant Summary collapse

ERROR_MESSAGE_PREFIXES =
{
  "number" => "Credit card number ",
  "CVV" => "CVV ",
  "expiration_month" => "Expiration month ",
  "expiration_year" => "Expiration year "
}

Instance Method Summary collapse

Constructor Details

#initialize(result, remote_errors) ⇒ Errors

Returns a new instance of Errors.



10
11
12
13
14
# File 'lib/ashmont/errors.rb', line 10

def initialize(result, remote_errors)
  @errors = {}
  parse_result(result)
  parse_remote_errors(remote_errors)
end

Instance Method Details

#to_hashObject



16
17
18
# File 'lib/ashmont/errors.rb', line 16

def to_hash
  @errors.dup
end