Class: ActiveResource::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/shopify_api/json_format.rb

Direct Known Subclasses

ShopifyAPI::Base

Instance Method Summary collapse

Instance Method Details

#encode(options = {}) ⇒ Object



3
4
5
6
7
8
# File 'lib/shopify_api/json_format.rb', line 3

def encode(options = {})
  same = dup
  same.attributes = {self.class.element_name => same.attributes} if self.class.format.extension == 'json'
  
  same.send("to_#{self.class.format.extension}", options)
end