class Epayco::Error

Set custom error

Attributes

errors[RW]

Public Class Methods

new(code, lang) click to toggle source

Get code, lang and show custom error

Calls superclass method
# File lib/epayco.rb, line 17
def initialize code, lang
  file = open("https://s3-us-west-2.amazonaws.com/epayco/message_api/errors.json").read
  data_hash = JSON.parse(file)
  super data_hash[code][lang]
  @errors = errors
end

Public Instance Methods

each() { |*first| ... } click to toggle source
# File lib/epayco.rb, line 24
def each
  @errors.each { |e| yield *e.first }
end