Class: Varejonline::Client

Inherits:
Object
  • Object
show all
Extended by:
ClassMethods
Includes:
HTTParty
Defined in:
lib/varejonline/client.rb

Defined Under Namespace

Classes: NoAccessTokenError, Response

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ClassMethods

require_all

Constructor Details

#initialize(access_token) ⇒ Client

Returns a new instance of Client.

Raises:



19
20
21
22
# File 'lib/varejonline/client.rb', line 19

def initialize(access_token)
  raise NoAccessTokenError if access_token.nil? || access_token.strip == ""
  @access_token = access_token
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



17
18
19
# File 'lib/varejonline/client.rb', line 17

def access_token
  @access_token
end

Instance Method Details

#card_negotiationsObject



100
101
102
# File 'lib/varejonline/client.rb', line 100

def card_negotiations
  Varejonline::API::CardNegotiations.new(@access_token)
end

#category_levelsObject



84
85
86
# File 'lib/varejonline/client.rb', line 84

def category_levels
  Varejonline::API::CategoryLevels.new(@access_token)
end

#client_classesObject



60
61
62
# File 'lib/varejonline/client.rb', line 60

def client_classes
  Varejonline::API::ClientClasses.new(@access_token)
end

#companiesObject



72
73
74
# File 'lib/varejonline/client.rb', line 72

def companies
  Varejonline::API::Companies.new(@access_token)
end

#credit_limitsObject



48
49
50
# File 'lib/varejonline/client.rb', line 48

def credit_limits
  Varejonline::API::CreditLimits.new(@access_token)
end

#default_entriesObject



32
33
34
# File 'lib/varejonline/client.rb', line 32

def default_entries
  Varejonline::API::DefaultEntries.new(@access_token)
end

#entitiesObject



28
29
30
# File 'lib/varejonline/client.rb', line 28

def entities
  Varejonline::API::Entities.new(@access_token)
end

#installmentsObject



44
45
46
# File 'lib/varejonline/client.rb', line 44

def installments
  Varejonline::API::Installments.new(@access_token)
end

#ordersObject



68
69
70
# File 'lib/varejonline/client.rb', line 68

def orders
  Varejonline::API::Orders.new(@access_token)
end

#payablesObject



56
57
58
# File 'lib/varejonline/client.rb', line 56

def payables
  Varejonline::API::Payables.new(@access_token)
end

#payment_conditionsObject



92
93
94
# File 'lib/varejonline/client.rb', line 92

def payment_conditions
  Varejonline::API::PaymentConditions.new(@access_token)
end

#paymentsObject



96
97
98
# File 'lib/varejonline/client.rb', line 96

def payments
  Varejonline::API::Payments.new(@access_token)
end

#product_categoriesObject



88
89
90
# File 'lib/varejonline/client.rb', line 88

def product_categories
  Varejonline::API::ProductCategories.new(@access_token)
end

#productsObject



80
81
82
# File 'lib/varejonline/client.rb', line 80

def products
  Varejonline::API::Products.new(@access_token)
end

#provisionsObject



36
37
38
# File 'lib/varejonline/client.rb', line 36

def provisions
  Varejonline::API::Provisions.new(@access_token)
end

#receivablesObject



52
53
54
# File 'lib/varejonline/client.rb', line 52

def receivables
  Varejonline::API::Receivables.new(@access_token)
end

#sales_historyObject



64
65
66
# File 'lib/varejonline/client.rb', line 64

def sales_history
  Varejonline::API::SalesHistory.new(@access_token)
end

#sellersObject



76
77
78
# File 'lib/varejonline/client.rb', line 76

def sellers
  Varejonline::API::Sellers.new(@access_token)
end

#third_partiesObject



24
25
26
# File 'lib/varejonline/client.rb', line 24

def third_parties
  Varejonline::API::ThirdParties.new(@access_token)
end

#user_dataObject



40
41
42
# File 'lib/varejonline/client.rb', line 40

def user_data
  Varejonline::API::UserData.new(@access_token)
end