pagoda-client 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pagoda-client/client.rb +21 -16
- data/pagoda-client.gemspec +1 -1
- metadata +1 -1
data/lib/pagoda-client/client.rb
CHANGED
@@ -13,7 +13,7 @@ require 'pagoda-client/apis/database'
|
|
13
13
|
|
14
14
|
module Pagoda
|
15
15
|
class Client
|
16
|
-
VERSION = "0.2.
|
16
|
+
VERSION = "0.2.2"
|
17
17
|
|
18
18
|
# Mix ins (cleaner)
|
19
19
|
include Apis::App
|
@@ -108,25 +108,30 @@ module Pagoda
|
|
108
108
|
end
|
109
109
|
|
110
110
|
def symbolize(hash)
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
111
|
+
if hash.is_a?(Hash)
|
112
|
+
new_hash = {}
|
113
|
+
hash.each do |key,value|
|
114
|
+
if value.is_a?(Hash)
|
115
|
+
new_hash[key.to_sym] = symbolize(value)
|
116
|
+
elsif value.is_a?(Array)
|
117
|
+
arr = []
|
118
|
+
value.each do |ele|
|
119
|
+
if ele.is_a?(Hash)
|
120
|
+
arr << symbolize(ele)
|
121
|
+
else
|
122
|
+
arr << ele
|
123
|
+
end
|
122
124
|
end
|
125
|
+
new_hash[key.to_sym] = arr
|
126
|
+
else
|
127
|
+
new_hash[key.to_sym] = value
|
123
128
|
end
|
124
|
-
new_hash[key.to_sym] = arr
|
125
|
-
else
|
126
|
-
new_hash[key.to_sym] = value
|
127
129
|
end
|
130
|
+
new_hash
|
131
|
+
elsif hash.is_a?(Array)
|
132
|
+
arr = []
|
133
|
+
hash.map {|hash| symbolize(hash) }
|
128
134
|
end
|
129
|
-
new_hash
|
130
135
|
end
|
131
136
|
|
132
137
|
end
|
data/pagoda-client.gemspec
CHANGED