-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Formatting: define inner modules using ::
- Loading branch information
Showing
17 changed files
with
465 additions
and
499 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
module Noko | ||
class Client | ||
def get_account | ||
get('/v2/account') | ||
end | ||
class Noko::Client | ||
def get_account | ||
get('/v2/account') | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
module Noko | ||
class Client | ||
def get_current_user | ||
get('/v2/current_user') | ||
end | ||
class Noko::Client | ||
def get_current_user | ||
get('/v2/current_user') | ||
end | ||
|
||
def get_current_user_entries(params = nil) | ||
get('/v2/current_user/entries', params) | ||
end | ||
def get_current_user_entries(params = nil) | ||
get('/v2/current_user/entries', params) | ||
end | ||
|
||
def get_current_user_expenses(params = nil) | ||
get('/v2/current_user/expenses', params) | ||
end | ||
def get_current_user_expenses(params = nil) | ||
get('/v2/current_user/expenses', params) | ||
end | ||
|
||
def update_current_user(attributes) | ||
put('/v2/current_user', attributes) | ||
end | ||
def update_current_user(attributes) | ||
put('/v2/current_user', attributes) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,47 @@ | ||
# frozen_string_literal: true | ||
|
||
module Noko | ||
class Client | ||
def get_entries(params = nil) | ||
get('/v2/entries', params) | ||
end | ||
|
||
def get_entry(id) | ||
get("/v2/entries/#{id}") | ||
end | ||
|
||
def create_entry(attributes) | ||
post('/v2/entries', attributes) | ||
end | ||
|
||
def update_entry(id, attributes) | ||
put("/v2/entries/#{id}", attributes) | ||
end | ||
|
||
def delete_entry(id) | ||
delete("/v2/entries/#{id}") | ||
end | ||
|
||
def mark_entry_invoiced(id, params) | ||
put("/v2/entries/#{id}/marked_as_invoiced", params) | ||
end | ||
|
||
def mark_entries_invoiced(params) | ||
put('/v2/entries/marked_as_invoiced', params) | ||
end | ||
|
||
def mark_entry_approved(id, params = nil) | ||
put("/v2/entries/#{id}/approved", params) | ||
end | ||
|
||
def mark_entries_approved(params) | ||
put('/v2/entries/approved', params) | ||
end | ||
|
||
def mark_entry_unapproved(id) | ||
put("/v2/entries/#{id}/unapproved") | ||
end | ||
|
||
def mark_entries_unapproved(params) | ||
put('/v2/entries/unapproved', params) | ||
end | ||
class Noko::Client | ||
def get_entries(params = nil) | ||
get('/v2/entries', params) | ||
end | ||
|
||
def get_entry(id) | ||
get("/v2/entries/#{id}") | ||
end | ||
|
||
def create_entry(attributes) | ||
post('/v2/entries', attributes) | ||
end | ||
|
||
def update_entry(id, attributes) | ||
put("/v2/entries/#{id}", attributes) | ||
end | ||
|
||
def delete_entry(id) | ||
delete("/v2/entries/#{id}") | ||
end | ||
|
||
def mark_entry_invoiced(id, params) | ||
put("/v2/entries/#{id}/marked_as_invoiced", params) | ||
end | ||
|
||
def mark_entries_invoiced(params) | ||
put('/v2/entries/marked_as_invoiced', params) | ||
end | ||
|
||
def mark_entry_approved(id, params = nil) | ||
put("/v2/entries/#{id}/approved", params) | ||
end | ||
|
||
def mark_entries_approved(params) | ||
put('/v2/entries/approved', params) | ||
end | ||
|
||
def mark_entry_unapproved(id) | ||
put("/v2/entries/#{id}/unapproved") | ||
end | ||
|
||
def mark_entries_unapproved(params) | ||
put('/v2/entries/unapproved', params) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
module Noko | ||
class Client | ||
def get_expenses(params = nil) | ||
get('/v2/expenses', params) | ||
end | ||
class Noko::Client | ||
def get_expenses(params = nil) | ||
get('/v2/expenses', params) | ||
end | ||
|
||
def get_expense(id) | ||
get("/v2/expenses/#{id}") | ||
end | ||
def get_expense(id) | ||
get("/v2/expenses/#{id}") | ||
end | ||
|
||
def create_expense(attributes) | ||
post('/v2/expenses', attributes) | ||
end | ||
def create_expense(attributes) | ||
post('/v2/expenses', attributes) | ||
end | ||
|
||
def update_expense(id, attributes) | ||
put("/v2/expenses/#{id}", attributes) | ||
end | ||
def update_expense(id, attributes) | ||
put("/v2/expenses/#{id}", attributes) | ||
end | ||
|
||
def delete_expense(id) | ||
delete("/v2/expenses/#{id}") | ||
end | ||
def delete_expense(id) | ||
delete("/v2/expenses/#{id}") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,39 @@ | ||
# frozen_string_literal: true | ||
|
||
module Noko | ||
class Client | ||
def get_invoices(params = nil) | ||
get('/v2/invoices', params) | ||
end | ||
|
||
def get_invoice(id) | ||
get("/v2/invoices/#{id}") | ||
end | ||
|
||
def create_invoice(attributes) | ||
post('/v2/invoices', attributes) | ||
end | ||
|
||
def update_invoice(id, attributes) | ||
put("/v2/invoices/#{id}", attributes) | ||
end | ||
|
||
def mark_invoice_paid(id) | ||
put("/v2/invoices/#{id}/paid") | ||
end | ||
|
||
def mark_invoice_unpaid(id) | ||
put("/v2/invoices/#{id}/unpaid") | ||
end | ||
|
||
def get_invoice_entries(id, params = nil) | ||
get("/v2/invoices/#{id}/entries", params) | ||
end | ||
|
||
def get_invoice_expenses(id, params = nil) | ||
get("/v2/invoices/#{id}/expenses", params) | ||
end | ||
|
||
def delete_invoice(id) | ||
delete("/v2/invoices/#{id}") | ||
end | ||
class Noko::Client | ||
def get_invoices(params = nil) | ||
get('/v2/invoices', params) | ||
end | ||
|
||
def get_invoice(id) | ||
get("/v2/invoices/#{id}") | ||
end | ||
|
||
def create_invoice(attributes) | ||
post('/v2/invoices', attributes) | ||
end | ||
|
||
def update_invoice(id, attributes) | ||
put("/v2/invoices/#{id}", attributes) | ||
end | ||
|
||
def mark_invoice_paid(id) | ||
put("/v2/invoices/#{id}/paid") | ||
end | ||
|
||
def mark_invoice_unpaid(id) | ||
put("/v2/invoices/#{id}/unpaid") | ||
end | ||
|
||
def get_invoice_entries(id, params = nil) | ||
get("/v2/invoices/#{id}/entries", params) | ||
end | ||
|
||
def get_invoice_expenses(id, params = nil) | ||
get("/v2/invoices/#{id}/expenses", params) | ||
end | ||
|
||
def delete_invoice(id) | ||
delete("/v2/invoices/#{id}") | ||
end | ||
end |
Oops, something went wrong.