travis-ci
236 of 236 new or added lines in 16 files covered. (100.0%)
7219 of 11573 relevant lines covered (62.38%)
33.13 hits per line
1 |
# encoding: utf-8
|
|
2 |
|
|
3 |
require 'faraday'
|
7 all except jruby-9000 ✔ |
4 |
require 'hashie'
|
7 all except jruby-9000 ✔ |
5 |
require 'github_api/mash'
|
7 all except jruby-9000 ✔ |
6 |
|
|
7 |
module Github |
7 all except jruby-9000 ✔ |
8 |
class Response::Mashify < Response |
7 all except jruby-9000 ✔ |
9 |
define_parser do |body|
|
7 all except jruby-9000 ✔ |
10 |
::Github::Mash.new body |
19 only 1.9.3 ✔ |
11 |
end
|
|
12 |
|
|
13 |
def parse(body) |
7 all except jruby-9000 ✔ |
14 |
case body
|
20 only 1.9.3 ✔ |
15 |
when Hash |
|
16 |
self.class.parser.call body
|
9 only 1.9.3 ✔ |
17 |
when Array |
|
18 |
body.map { |item| item.is_a?(Hash) ? self.class.parser.call(item) : item } |
24 only 1.9.3 ✔ |
19 |
else
|
|
20 |
body |
× |
21 |
end
|
|
22 |
end
|
|
23 |
end # Response::Mashify |
|
24 |
end # Github |