Class: YNAB::API

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

Direct Known Subclasses

YnabApi::Client

Instance Method Summary collapse

Constructor Details

#initialize(access_token, host = 'api.ynab.com', useHttps = true) ⇒ API

Returns a new instance of API.



128
129
130
131
132
133
134
135
136
# File 'lib/ynab.rb', line 128

def initialize(access_token, host = 'api.ynab.com', useHttps = true)
  config = Configuration.default
  config.access_token = access_token
  config.scheme = useHttps ? 'https' : 'http'
  config.host = host
  config.base_path = '/v1'

  @client = ApiClient.new(config)
end

Instance Method Details

#accountsObject



146
147
148
# File 'lib/ynab.rb', line 146

def accounts
  AccountsApi.new(@client)
end

#budgetsObject



142
143
144
# File 'lib/ynab.rb', line 142

def budgets
  BudgetsApi.new(@client)
end

#categoriesObject



150
151
152
# File 'lib/ynab.rb', line 150

def categories
  CategoriesApi.new(@client)
end

#last_requestObject



174
175
176
# File 'lib/ynab.rb', line 174

def last_request
  @client.last_request
end

#monthsObject



154
155
156
# File 'lib/ynab.rb', line 154

def months
  MonthsApi.new(@client)
end

#payee_locationsObject



162
163
164
# File 'lib/ynab.rb', line 162

def payee_locations
  PayeeLocationsApi.new(@client)
end

#payeesObject



158
159
160
# File 'lib/ynab.rb', line 158

def payees
  PayeesApi.new(@client)
end

#scheduled_transactionsObject



170
171
172
# File 'lib/ynab.rb', line 170

def scheduled_transactions
  ScheduledTransactionsApi.new(@client)
end

#transactionsObject



166
167
168
# File 'lib/ynab.rb', line 166

def transactions
  YNAB::Overrides::TransactionsApi.new(@client)
end

#userObject



138
139
140
# File 'lib/ynab.rb', line 138

def user
  UserApi.new(@client)
end