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.



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

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



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

def accounts
  AccountsApi.new(@client)
end

#budgetsObject



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

def budgets
  BudgetsApi.new(@client)
end

#categoriesObject



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

def categories
  CategoriesApi.new(@client)
end

#last_requestObject



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

def last_request
  @client.last_request
end

#monthsObject



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

def months
  MonthsApi.new(@client)
end

#payee_locationsObject



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

def payee_locations
  PayeeLocationsApi.new(@client)
end

#payeesObject



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

def payees
  PayeesApi.new(@client)
end

#scheduled_transactionsObject



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

def scheduled_transactions
  ScheduledTransactionsApi.new(@client)
end

#transactionsObject



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

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

#userObject



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

def user
  UserApi.new(@client)
end