Class: Spree::API::Client

Inherits:
Object
  • Object
show all
Includes:
Addresses, Connection, Countries, LineItems, Orders, Payments, Products, Properties, Request, ReturnAuthorizations, Shipments, Taxonomies, Taxons, Variants, Zones
Defined in:
lib/spree-api-client.rb,
lib/spree-api-client/error.rb,
lib/spree-api-client/zones.rb,
lib/spree-api-client/orders.rb,
lib/spree-api-client/taxons.rb,
lib/spree-api-client/request.rb,
lib/spree-api-client/version.rb,
lib/spree-api-client/payments.rb,
lib/spree-api-client/products.rb,
lib/spree-api-client/variants.rb,
lib/spree-api-client/addresses.rb,
lib/spree-api-client/countries.rb,
lib/spree-api-client/shipments.rb,
lib/spree-api-client/connection.rb,
lib/spree-api-client/line_items.rb,
lib/spree-api-client/properties.rb,
lib/spree-api-client/taxonomies.rb,
lib/spree-api-client/return_authorizations.rb

Defined Under Namespace

Modules: Addresses, Connection, Countries, LineItems, Orders, Payments, Products, Properties, Request, ReturnAuthorizations, Shipments, Taxonomies, Taxons, Variants, Zones Classes: Error

Constant Summary collapse

VERSION =
"0.0.2"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Shipments

#ship_shipment, #shipment_ready

Methods included from Payments

#authorize_payment, #capture_payment, #create_payment, #credit_payment, #new_payment, #payment, #payments, #purchase_payment, #void_payment

Methods included from Taxons

#create_taxon, #delete_taxon, #taxon, #taxons, #update_taxon

Methods included from ReturnAuthorizations

#create_return_authorization, #delete_return_authorization, #new_return_authorization, #return_authorization, #return_authorizations, #update_return_authorization

Methods included from LineItems

#create_line_item, #delete_line_item, #update_line_item

Methods included from Properties

#create_property, #delete_property, #new_property, #properties, #property, #update_property

Methods included from Zones

#create_zone, #delete_zone, #new_zone, #update_zone, #zone, #zones

Methods included from Countries

#countries, #country

Methods included from Addresses

#address, #update_address

Methods included from Taxonomies

#create_taxonomy, #delete_taxonomy, #new_taxonomy, #taxonomies, #taxonomy, #update_taxonomy

Methods included from Orders

#create_order, #empty_order, #order, #orders, #set_order_shipping_method, #update_order_address

Methods included from Variants

#create_variant, #delete_variant, #new_variant, #update_variant, #variant, #variants

Methods included from Products

#create_product, #delete_product, #new_product, #product, #products, #update_product

Methods included from Request

#delete, #get, #post, #put, #request

Methods included from Connection

#connection

Constructor Details

#initialize(api_endpoint, api_token, options = {}) ⇒ Client

Returns a new instance of Client.



42
43
44
45
46
# File 'lib/spree-api-client.rb', line 42

def initialize(api_endpoint, api_token, options={})
  @api_endpoint = api_endpoint
  @api_token = api_token
  @per_page = options.fetch(:per_page, 30)
end

Instance Attribute Details

#api_endpointObject

Returns the value of attribute api_endpoint.



41
42
43
# File 'lib/spree-api-client.rb', line 41

def api_endpoint
  @api_endpoint
end

#api_tokenObject

Returns the value of attribute api_token.



41
42
43
# File 'lib/spree-api-client.rb', line 41

def api_token
  @api_token
end

#per_pageObject

Returns the value of attribute per_page.



41
42
43
# File 'lib/spree-api-client.rb', line 41

def per_page
  @per_page
end