class Pixmatch::Error

Custom error class for rescuing from all known Pixmatch errors.

Attributes

detail[RW]
method[RW]
status[RW]

Public Class Methods

new(json) click to toggle source
# File lib/pixmatch/error.rb, line 6
def initialize(json)
  @status = json['status']
  @method = json['method']
  @error = json['error']
  @result = json['result']
end

Public Instance Methods

to_s() click to toggle source
# File lib/pixmatch/error.rb, line 13
def to_s
  s = @error.nil? ? 'Unexpected Error' : @error.join('\r\n')
  s += ("\r\n " + @result.join('\r\n ')) if @result
end