Class: YNAB::API
- Inherits:
-
Object
- Object
- YNAB::API
- Defined in:
- lib/ynab.rb
Direct Known Subclasses
Instance Method Summary collapse
- #accounts ⇒ Object
- #budgets ⇒ Object
- #categories ⇒ Object
-
#initialize(access_token, host = 'api.youneedabudget.com', useHttps = true) ⇒ API
constructor
A new instance of API.
- #last_request ⇒ Object
- #months ⇒ Object
- #payee_locations ⇒ Object
- #payees ⇒ Object
- #scheduled_transactions ⇒ Object
- #transactions ⇒ Object
- #user ⇒ Object
Constructor Details
#initialize(access_token, host = 'api.youneedabudget.com', useHttps = true) ⇒ API
Returns a new instance of API.
111 112 113 114 115 116 117 118 119 120 |
# File 'lib/ynab.rb', line 111 def initialize(access_token, host = 'api.youneedabudget.com', useHttps = true) config = Configuration.default config.api_key['Authorization'] = access_token config.api_key_prefix['Authorization'] = 'Bearer' config.scheme = useHttps ? 'https' : 'http' config.host = host config.base_path = '/v1' @client = ApiClient.new(config) end |
Instance Method Details
#accounts ⇒ Object
130 131 132 |
# File 'lib/ynab.rb', line 130 def accounts AccountsApi.new(@client) end |
#budgets ⇒ Object
126 127 128 |
# File 'lib/ynab.rb', line 126 def budgets BudgetsApi.new(@client) end |
#categories ⇒ Object
134 135 136 |
# File 'lib/ynab.rb', line 134 def categories CategoriesApi.new(@client) end |
#last_request ⇒ Object
158 159 160 |
# File 'lib/ynab.rb', line 158 def last_request @client.last_request end |
#months ⇒ Object
138 139 140 |
# File 'lib/ynab.rb', line 138 def months MonthsApi.new(@client) end |
#payee_locations ⇒ Object
146 147 148 |
# File 'lib/ynab.rb', line 146 def payee_locations PayeeLocationsApi.new(@client) end |
#payees ⇒ Object
142 143 144 |
# File 'lib/ynab.rb', line 142 def payees PayeesApi.new(@client) end |
#scheduled_transactions ⇒ Object
154 155 156 |
# File 'lib/ynab.rb', line 154 def scheduled_transactions ScheduledTransactionsApi.new(@client) end |
#transactions ⇒ Object
150 151 152 |
# File 'lib/ynab.rb', line 150 def transactions YNAB::Overrides::TransactionsApi.new(@client) end |
#user ⇒ Object
122 123 124 |
# File 'lib/ynab.rb', line 122 def user UserApi.new(@client) end |