Sha256: 7c7a807cb18c8df2470ec73ce45b4aeb1aae7cf02fd756479271ed6f4e9ee508
Contents?: true
Size: 432 Bytes
Versions: 13
Compression:
Stored size: 432 Bytes
Contents
module WxPay class Result < ::Hash SUCCESS_FLAG = 'SUCCESS'.freeze def initialize(result) super nil # Or it will call `super result` self[:raw] = result if result['xml'].class == Hash result['xml'].each_pair do |k, v| self[k] = v end end end def success? self['return_code'] == SUCCESS_FLAG && self['result_code'] == SUCCESS_FLAG end end end
Version data entries
13 entries across 13 versions & 1 rubygems