Class: Shopifydev::Shop

Inherits:
Object
  • Object
show all
Defined in:
lib/shopifydev/shop.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(credentials) ⇒ Shop

Returns a new instance of Shop.



8
9
10
11
12
13
14
15
16
17
# File 'lib/shopifydev/shop.rb', line 8

def initialize(credentials)
  @credentials = credentials
  @logger = Logger.new(STDOUT)

  ShopifyAPI::Base.site = "https://" + 
    credentials['api_key'] + ':' + 
    credentials['password'] + '@' + 
    credentials['url'] + '/admin' 
  logger.debug("set shopify site to #{ShopifyAPI::Base.site}")
end

Instance Attribute Details

#credentialsObject

Returns the value of attribute credentials.



6
7
8
# File 'lib/shopifydev/shop.rb', line 6

def credentials
  @credentials
end

#loggerObject

Returns the value of attribute logger.



6
7
8
# File 'lib/shopifydev/shop.rb', line 6

def logger
  @logger
end

#project_rootObject

Returns the value of attribute project_root.



6
7
8
# File 'lib/shopifydev/shop.rb', line 6

def project_root
  @project_root
end

Instance Method Details

#asset(path) ⇒ Object



33
34
35
# File 'lib/shopifydev/shop.rb', line 33

def asset(path)
  Asset.new(self, path, project_root)
end

#templateObject



29
30
31
# File 'lib/shopifydev/shop.rb', line 29

def template
  @template ||= Template.new(self, project_root)
end