mogli 0.0.27 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/mogli/client.rb +2 -2
- data/lib/mogli/model.rb +1 -1
- metadata +4 -4
data/lib/mogli/client.rb
CHANGED
@@ -138,9 +138,9 @@ module Mogli
|
|
138
138
|
#protected
|
139
139
|
|
140
140
|
def extract_hash_or_array(hash_or_array,klass)
|
141
|
+
hash_or_array = hash_or_array.parsed_response if hash_or_array.respond_to?(:parsed_response)
|
141
142
|
return nil if hash_or_array == false
|
142
143
|
return hash_or_array if hash_or_array.nil? or hash_or_array.kind_of?(Array)
|
143
|
-
hash_or_array = hash_or_array.parsed_response if hash_or_array.respond_to?(:parsed_response)
|
144
144
|
return extract_fetching_array(hash_or_array,klass) if is_fetching_array?(hash_or_array)
|
145
145
|
return hash_or_array
|
146
146
|
end
|
@@ -162,7 +162,7 @@ module Mogli
|
|
162
162
|
end
|
163
163
|
|
164
164
|
def map_to_class(hash_or_array,klass)
|
165
|
-
return nil if hash_or_array
|
165
|
+
return nil if !hash_or_array
|
166
166
|
if hash_or_array.kind_of?(Array)
|
167
167
|
hash_or_array.map! {|i| create_instance(klass,i)}
|
168
168
|
else
|
data/lib/mogli/model.rb
CHANGED
@@ -150,7 +150,7 @@ module Mogli
|
|
150
150
|
end
|
151
151
|
|
152
152
|
def self.find(id,client=nil, *fields)
|
153
|
-
body_args = fields.empty? ? {} : {:fields => fields}
|
153
|
+
body_args = fields.empty? ? {} : {:fields => fields.join(',')}
|
154
154
|
(id, body_args[:ids] = "", id.join(',')) if id.is_a?(Array)
|
155
155
|
(client||Mogli::Client.new).get_and_map(id,self, body_args)
|
156
156
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mogli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 39
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 28
|
10
|
+
version: 0.0.28
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Mike Mangino
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-04-14 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|