Class: Asaas::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/asaas/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token = nil, api_version = nil) ⇒ Client

Returns a new instance of Client.



6
7
8
9
# File 'lib/asaas/client.rb', line 6

def initialize(token = nil, api_version = nil)
  @token = token || Asaas::Configuration.token
  @api_version = api_version || Asaas::Configuration.api_version
end

Instance Attribute Details

#tokenObject (readonly)

Returns the value of attribute token.



4
5
6
# File 'lib/asaas/client.rb', line 4

def token
  @token
end

Instance Method Details

#accountsObject



11
12
13
# File 'lib/asaas/client.rb', line 11

def accounts
  @accounts ||= Asaas::Api::Account.new(@token, @api_version)
end

#citiesObject



15
16
17
# File 'lib/asaas/client.rb', line 15

def cities
  @cities ||= Asaas::Api::City.new(@token, @api_version)
end

#customersObject



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

def customers
  @customers ||= Asaas::Api::Customer.new(@token, @api_version)
end

#documentsObject



43
44
45
# File 'lib/asaas/client.rb', line 43

def documents
  @documents ||= Asaas::Api::Document.new(@token)
end

#notificationsObject



23
24
25
# File 'lib/asaas/client.rb', line 23

def notifications
  @notifications ||= Asaas::Api::Notification.new(@token, @api_version)
end

#paymentsObject



27
28
29
# File 'lib/asaas/client.rb', line 27

def payments
  @payments ||= Asaas::Api::Payment.new(@token, @api_version)
end

#subscriptionsObject



31
32
33
# File 'lib/asaas/client.rb', line 31

def subscriptions
  @subscriptions ||= Asaas::Api::Subscription.new(@token, @api_version)
end

#transfersObject



35
36
37
# File 'lib/asaas/client.rb', line 35

def transfers
  @transfers ||= Asaas::Api::Transfer.new(@token, @api_version)
end

#webhooksObject



39
40
41
# File 'lib/asaas/client.rb', line 39

def webhooks
  @webhooks ||= Asaas::Api::Webhook.new(@token, @api_version)
end