Sha256: 7395b39fe26f53af90f7e296097ee5bffb4d1372f6418faca7b17ca829be30b4

Contents?: true

Size: 790 Bytes

Versions: 2

Compression:

Stored size: 790 Bytes

Contents

class Wegift::Response

  STATUS = {:success => 'SUCCESS', :error => 'ERROR'}

  # Field Name Contents
  #
  # status        - The status of the transaction. Usually “SUCCESS” or “ERROR”
  # error_code    - The error code, i.e. SE002
  # error_string  - Description of the error code, i.e. Required field missing from request
  # error_details - Details of the particular error, i.e. Field "delivery" missing from request

  # global shared body
  attr_accessor :status, :error_code, :error_string, :error_details

  def is_successful?
    @status && @status.eql?(STATUS[:success])
  end

  def parse(data = {})
    @status = data['status']
    @error_code = data['error_code']
    @error_string = data['error_string']
    @error_details = data['error_details']
  end

  # TODO

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wegift-ruby-client-0.1.1 lib/wegift/models/response.rb
wegift-ruby-client-0.1.0 lib/wegift/models/response.rb