# File lib/github_api/error/service_error.rb, line 56 def self.errors @errors ||= Hash[ descendants.map { |klass| [klass.new({}).http_status_code, klass] } ] end
# File lib/github_api/error/service_error.rb, line 23 def decode_body(body) if body.respond_to?(:to_str) && body.length >= 2 decode body, :symbolize_keys => true else body end end
# File lib/github_api/error/service_error.rb, line 31 def parse_body(body) body = decode_body(body) return '' if body.nil? || body.empty? if body[:error] body[:error] elsif body[:errors] error = Array(body[:errors]).first if error.kind_of?(Hash) error[:message] else error end elsif body[:message] body[:message] else '' end end
Generated with the Darkfish Rdoc Generator 2.