Module: ActiveResource::Formats::JsonFormat

Defined in:
lib/shopify_api/json_format.rb

Instance Method Summary collapse

Instance Method Details

#decode(json) ⇒ Object


7
8
9
10
11
12
13
14
# File 'lib/shopify_api/json_format.rb', line 7

def decode(json)
  data = ActiveSupport::JSON.decode(json)
  if data.is_a?(Hash) && data.keys.size == 1
    data.values.first
  else
    data
  end
end