copperegg 0.6.0.pre2 → 0.6.0.pre3

Sign up to get free protection for your applications and to get access to all the features.
Binary file
File without changes
@@ -12,12 +12,13 @@ module CopperEgg
12
12
  params = args.last.class == Hash ? args.pop : {}
13
13
  id = args.first
14
14
  response = request(params.merge(:request_type => "get", :id => id))
15
- if response && response.is_a?(Array)
16
- response.map do |resp|
17
- new JSON.parse(resp.body)
15
+ if response.code == "200"
16
+ json = JSON.parse(response.body)
17
+ if json.is_a?(Array)
18
+ json.map {|attributes| new(attributes)}
19
+ else
20
+ new(json)
18
21
  end
19
- elsif response
20
- new JSON.parse(response.body)
21
22
  end
22
23
  end
23
24
 
@@ -1,3 +1,3 @@
1
1
  module CopperEgg
2
- GEM_VERSION = '0.6.0.pre2'
2
+ GEM_VERSION = '0.6.0.pre3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: copperegg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0.pre2
4
+ version: 0.6.0.pre3
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -35,6 +35,7 @@ extra_rdoc_files: []
35
35
  files:
36
36
  - ./CHANGELOG.md
37
37
  - ./copperegg-0.6.0.pre2.gem
38
+ - ./copperegg-0.6.0.pre3.gem
38
39
  - ./copperegg.gemspec
39
40
  - ./Gemfile
40
41
  - ./Gemfile.lock