Module: Freshbooks::API::CRUD
- Included in:
- Client
- Defined in:
- lib/freshbooks/api/crud.rb
Overview
Methods for CRUD in [Freshbooks::Client].
Instance Method Summary collapse
-
#create(params = {}) ⇒ Object
Creates something based on params.
-
#delete(params = {}) ⇒ Object
Delete something based on its ‘<something>_id`.
-
#get(params = {}) ⇒ Object
Get something’s details based on the ‘<something>_id`.
-
#list(params = {}) ⇒ Object
List a bunch of somethings.
-
#update(params = {}) ⇒ Object
Updates something based on params.
Instance Method Details
#create(params = {}) ⇒ Object
Creates something based on params.
12 13 14 |
# File 'lib/freshbooks/api/crud.rb', line 12 def create(params = {}) call("#{@endpoint}.create", { @endpoint => params }) end |
#delete(params = {}) ⇒ Object
Delete something based on its ‘<something>_id`.
45 46 47 |
# File 'lib/freshbooks/api/crud.rb', line 45 def delete(params = {}) call("#{@endpoint}.delete", params) end |
#get(params = {}) ⇒ Object
Get something’s details based on the ‘<something>_id`.
34 35 36 |
# File 'lib/freshbooks/api/crud.rb', line 34 def get(params = {}) call("#{@endpoint}.get", params) end |
#list(params = {}) ⇒ Object
List a bunch of somethings.
56 57 58 |
# File 'lib/freshbooks/api/crud.rb', line 56 def list(params = {}) call("#{@endpoint}.list", params) end |
#update(params = {}) ⇒ Object
Updates something based on params.
23 24 25 |
# File 'lib/freshbooks/api/crud.rb', line 23 def update(params = {}) call("#{@endpoint}.update", { @endpoint => params }) end |