Class: InsalesApi::Base
Direct Known Subclasses
Account, ApplicationCharge, ApplicationWidget, Asset, Category, Characteristic, Client, ClientGroup, Collect, Collection, Currency, CustomStatus, DeliveryVariant, DiscountCode, Domain, Field, File, Image, JsTag, Marketplace, Notification, OptionName, OptionValue, Order, OrderLine, Page, PaymentGateway, PickUpSource, PriceKind, Product, ProductField, ProductFieldValue, Property, RecurringApplicationCharge, StockCurrency, Theme, User, Variant, Webhook
Class Method Summary
collapse
count
find_each, find_in_batches
Class Method Details
21
22
23
24
25
26
|
# File 'lib/insales_api/base.rb', line 21
def configure(api_key, domain, password)
self.user = api_key
self.site = "http://#{domain}"
self.password = password
self
end
|
.dump_config ⇒ Object
28
29
30
31
32
33
34
|
# File 'lib/insales_api/base.rb', line 28
def dump_config
{
user: self.user,
site: self.site,
password: self.password,
}
end
|
.for_account(account) ⇒ Object
43
44
45
|
# File 'lib/insales_api/base.rb', line 43
def for_account(account)
ActiveResourceProxy.new(account, self)
end
|
.restore_config(options) ⇒ Object
36
37
38
39
40
41
|
# File 'lib/insales_api/base.rb', line 36
def restore_config(options)
self.user = options[:user]
self.site = options[:site]
self.password = options[:password]
true
end
|