Sha256: 4c924c212b30ff0f869e4430754c2b2ab191b707dcf6dfc4670f3838bdc55bb8
Contents?: true
Size: 545 Bytes
Versions: 23
Compression:
Stored size: 545 Bytes
Contents
module Katapaty class JsonResponseError < StandardError; end class ResponseError < StandardError attr_reader :data_type attr_reader :data_args attr_reader :data_message attr_reader :code attr_reader :message_class def initialize(json) @message_class, @code = json['message'], json['code'] json['data'].each_pair do |(k,v)| instance_variable_set '@data_%s' % k, v end if json.has_key? 'data' super end def message "#{@message_class}:#{@data_message}" end end end
Version data entries
23 entries across 23 versions & 1 rubygems