Module: Cornerstore

Defined in:
lib/cornerstore/model.rb,
lib/cornerstore/version.rb,
lib/cornerstore/resource.rb,
lib/cornerstore.rb

Defined Under Namespace

Modules: Model, Resource Classes: Address, Cancellation, Carrier, Cart, Collection, Customer, DifferentiatingProperty, Image, LineItem, Order, PaymentMeans, Price, Product, Property, Search, Shipment, Variant

Constant Summary collapse

VERSION =
'0.6.2'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_key=(value) ⇒ Object

Sets the attribute api_key

Parameters:

  • value

    the value to set the attribute api_key to.



19
20
21
# File 'lib/cornerstore.rb', line 19

def api_key=(value)
  @api_key = value
end

.subdomainObject



22
23
24
# File 'lib/cornerstore.rb', line 22

def self.subdomain
  @subdomain ||= read_config[:subdomain]
end

Class Method Details

.assets_urlObject



30
31
32
# File 'lib/cornerstore.rb', line 30

def self.assets_url
  "http://cskit-production.s3.amazonaws.com"
end

.headersObject



34
35
36
37
38
39
# File 'lib/cornerstore.rb', line 34

def self.headers
  {
    user_agent: "cornerstore-gem/#{Cornerstore::VERSION}",
    authorization: "Token #{api_key}"
  }
end

.root_urlObject



26
27
28
# File 'lib/cornerstore.rb', line 26

def self.root_url
  "https://#{subdomain}.cornerstore.io/api/v1"
end