Class: Spree::API::Client
- Inherits:
-
Object
- Object
- Spree::API::Client
- Includes:
- Addresses, Adjustments, Checkouts, Connection, Countries, CreditCards, LineItems, Orders, Payments, Products, Promotions, Properties, Request, ReturnAuthorizations, Shipments, StockItems, StockLocations, Taxonomies, Taxons, Users, Variants, Zones
- Defined in:
- lib/spree-api-client.rb,
lib/spree-api-client/error.rb,
lib/spree-api-client/users.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/checkouts.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/promotions.rb,
lib/spree-api-client/properties.rb,
lib/spree-api-client/taxonomies.rb,
lib/spree-api-client/adjustments.rb,
lib/spree-api-client/stock_items.rb,
lib/spree-api-client/credit_cards.rb,
lib/spree-api-client/option_types.rb,
lib/spree-api-client/option_values.rb,
lib/spree-api-client/stock_locations.rb,
lib/spree-api-client/return_authorizations.rb
Defined Under Namespace
Modules: Addresses, Adjustments, Checkouts, Connection, Countries, CreditCards, LineItems, OptionTypes, OptionValues, Orders, Payments, Products, Promotions, Properties, Request, ReturnAuthorizations, Shipments, StockItems, StockLocations, Taxonomies, Taxons, Users, Variants, Zones Classes: Error
Constant Summary collapse
- VERSION =
"0.0.10"
Instance Attribute Summary collapse
-
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
-
#api_token ⇒ Object
Returns the value of attribute api_token.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#per_page ⇒ Object
Returns the value of attribute per_page.
Instance Method Summary collapse
-
#initialize(api_endpoint, api_token, locale = "en-US", options = {}) ⇒ Client
constructor
A new instance of Client.
Methods included from Promotions
Methods included from Adjustments
#adjustment, #adjustments, #create_adjustment, #update_adjustment
Methods included from CreditCards
#authorize_credit_card, #credit_card, #credit_cards
Methods included from Shipments
#ship_shipment, #shipment_ready, #shipments, #update_shipment
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, #taxonomy_taxon, #taxonomy_taxons, #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 StockItems
#batch_update_stock_items, #create_stock_item, #delete_stock_item, #new_stock_item, #stock_item, #stock_items, #update_stock_item
Methods included from StockLocations
#create_stock_location, #delete_stock_location, #new_stock_location, #stock_location, #stock_locations, #update_stock_location
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
Methods included from Addresses
Methods included from Taxonomies
#create_taxonomy, #delete_taxonomy, #new_taxonomy, #taxonomies, #taxonomy, #update_taxonomy
Methods included from Orders
#cancel_order, #create_order, #empty_order, #order, #order_completed?, #orders, #prepare_order_for_checkout, #set_order_owner, #set_order_shipping_method, #update_order, #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, #product_by_sku, #products, #update_product
Methods included from Checkouts
#checkout, #checkouts, #create_checkout, #next, #update_checkout
Methods included from Users
#create_anonymous_user, #create_user, #delete_user, #update_users, #user, #users
Methods included from Request
#delete, #get, #post, #put, #request
Methods included from Connection
Constructor Details
#initialize(api_endpoint, api_token, locale = "en-US", options = {}) ⇒ Client
Returns a new instance of Client.
57 58 59 60 61 62 |
# File 'lib/spree-api-client.rb', line 57 def initialize(api_endpoint, api_token, locale="en-US", ={}) @api_endpoint = api_endpoint @api_token = api_token @locale = locale @per_page = .fetch(:per_page, 30) end |
Instance Attribute Details
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
56 57 58 |
# File 'lib/spree-api-client.rb', line 56 def api_endpoint @api_endpoint end |
#api_token ⇒ Object
Returns the value of attribute api_token.
56 57 58 |
# File 'lib/spree-api-client.rb', line 56 def api_token @api_token end |
#locale ⇒ Object
Returns the value of attribute locale.
56 57 58 |
# File 'lib/spree-api-client.rb', line 56 def locale @locale end |
#per_page ⇒ Object
Returns the value of attribute per_page.
56 57 58 |
# File 'lib/spree-api-client.rb', line 56 def per_page @per_page end |