Sha256: 7db5aebd930ce74a9a8df3cb721ec3c5433f4ee5ac3c00c1b6e8edc1a862bef2
Contents?: true
Size: 582 Bytes
Versions: 16
Compression:
Stored size: 582 Bytes
Contents
module Telegram module Bot module Exceptions class ResponseError < Base attr_reader :response def initialize(response) @response = response end def to_s super + format(' (%s)', data.map { |k, v| %(#{k}: "#{v}") }.join(', ')) end private def data @data ||= begin JSON.parse(response.body) rescue JSON::ParserError { error_code: response.code, uri: response.request.last_uri.to_s } end end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems