Class: VersacommerceAPI::Shop

Inherits:
Base
  • Object
show all
Includes:
Metafieldable
Defined in:
lib/versacommerce_api/resources/shop.rb

Overview

Shop object. Use Shop.current to receive the shop.

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Metafieldable

#add_metafield, #metafields

Methods inherited from Base

activate_session, all, clear_session, headers, root!

Methods included from Countable

#count

Class Method Details

.collection_nameObject



7
8
9
# File 'lib/versacommerce_api/resources/shop.rb', line 7

def self.collection_name
  'shop'
end

.currentObject



15
16
17
# File 'lib/versacommerce_api/resources/shop.rb', line 15

def self.current
  find(:one, from: '/api/shop.xml')
end

.element_path(id, prefix_options = {}, query_options = nil) ⇒ Object



11
12
13
# File 'lib/versacommerce_api/resources/shop.rb', line 11

def self.element_path(id, prefix_options = {}, query_options = nil)
  "#{prefix(prefix_options)}#{collection_name}#{format_extension}#{query_string(query_options)}"
end

Instance Method Details

#to_xml(options = {}) ⇒ Object



19
20
21
# File 'lib/versacommerce_api/resources/shop.rb', line 19

def to_xml(options = {})
  super(only: [:current_design, :current_sandbox_design, :current_facebook_design])
end