mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #1378 from carlallen/master
Fog is set to require multi_json 1.0, which does not have dump/load methods
This commit is contained in:
commit
045ee504ac
1 changed files with 4 additions and 16 deletions
|
@ -21,24 +21,12 @@ module Fog
|
||||||
# Do the MultiJson introspection at this level so we can define our encode/decode methods and perform
|
# Do the MultiJson introspection at this level so we can define our encode/decode methods and perform
|
||||||
# the introspection only once rather than once per call.
|
# the introspection only once rather than once per call.
|
||||||
|
|
||||||
if MultiJson.respond_to?(:dump)
|
def self.encode(obj)
|
||||||
def self.encode(obj)
|
MultiJson.encode(obj)
|
||||||
MultiJson.dump(obj)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
def self.encode(obj)
|
|
||||||
MultiJson.encode(obj)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if MultiJson.respond_to?(:load)
|
def self.decode(obj)
|
||||||
def self.decode(obj)
|
MultiJson.decode(obj)
|
||||||
MultiJson.load(obj)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
def self.decode(obj)
|
|
||||||
MultiJson.decode(obj)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue