Module: ActiveModel::Serializers::JSON

Defined in:
lib/shopify_api/json_format.rb

Instance Method Summary collapse

Instance Method Details

#as_json(options = nil) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/shopify_api/json_format.rb', line 28

def as_json(options = nil)
  root = options[:root] if options.try(:key?, :root)
  if include_root_in_json
    root = self.class.model_name.element if root == true
    { root => serializable_hash(options) }
  else
    serializable_hash(options)
  end
end