bloc-atlas 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/atlas.gemspec +1 -1
- data/lib/client/{class_factory.rb → atlas_class_factory.rb} +3 -3
- data/lib/client/base_atlas_client.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 619cbc34d873d222d21ee9effe016c0f086ab373
|
4
|
+
data.tar.gz: a4f58755598e2d5e53f489a3098acd23bba08931
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7f6c41cdf06ece55b0442f3e0b2c1fefea269a353d329beb0d6c9568f8410dc4775557210b8dbcc23c55296650cac3843cb636cf020684081a18de8a08b1d73
|
7
|
+
data.tar.gz: 6e123eecb6340e6223eb43c78cde7fa489edbb1bc31be0db65dca9d36861dd11af11ca982a7a62f8413bbbd88635a29b1a7e5de39154dba70b45201129332883
|
data/atlas.gemspec
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'json'
|
2
2
|
require 'active_support/inflector'
|
3
3
|
|
4
|
-
module
|
5
|
-
def
|
4
|
+
module AtlasClassFactory
|
5
|
+
def AtlasClassFactory.build_response_object(response_hash, name)
|
6
6
|
if Object.const_defined?(name.camelize)
|
7
7
|
name.camelize.constantize.new(response_hash)
|
8
8
|
else
|
9
|
-
generic_class =
|
9
|
+
generic_class = AtlasClassFactory::GenericClass.new
|
10
10
|
generic_class.create_class name
|
11
11
|
name.camelize.constantize.new(response_hash)
|
12
12
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative '
|
1
|
+
require_relative 'atlas_class_factory'
|
2
2
|
|
3
3
|
module BaseAtlasClient
|
4
4
|
# Handle API timeouts
|
@@ -16,9 +16,9 @@ module BaseAtlasClient
|
|
16
16
|
body = response.body.is_a?(String) ? JSON.parse(response.body) : response.body
|
17
17
|
|
18
18
|
if body.is_a?(Array)
|
19
|
-
body.map {|hash|
|
19
|
+
body.map {|hash| AtlasClassFactory.build_response_object(hash, name)}
|
20
20
|
else
|
21
|
-
|
21
|
+
AtlasClassFactory.build_response_object(body, name)
|
22
22
|
end
|
23
23
|
else
|
24
24
|
return response
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bloc-atlas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Madden
|
@@ -137,8 +137,8 @@ files:
|
|
137
137
|
- Rakefile
|
138
138
|
- atlas.gemspec
|
139
139
|
- lib/atlas.rb
|
140
|
+
- lib/client/atlas_class_factory.rb
|
140
141
|
- lib/client/base_atlas_client.rb
|
141
|
-
- lib/client/class_factory.rb
|
142
142
|
- lib/client/exercises.rb
|
143
143
|
homepage: http://rubygems.org/gems/bloc-atlas
|
144
144
|
licenses:
|