Module: Jibeset::Client::Boat
- Included in:
- Jibeset::Client
- Defined in:
- lib/jibeset/client/boats.rb
Instance Method Summary collapse
- #boat(payload) ⇒ Object
- #boats(payload = {}) ⇒ Object
- #destroy_boat(payload) ⇒ Object
- #update_boat(payload) ⇒ Object
Instance Method Details
#boat(payload) ⇒ Object
15 16 17 |
# File 'lib/jibeset/client/boats.rb', line 15 def boat(payload) get("/boats/#{payload[:id]}") end |
#boats(payload = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/jibeset/client/boats.rb', line 5 def boats(payload={}) if payload[:boat] post('/boats', payload) elsif payload[:user_id] get("/users/#{payload[:user_id]}/boats") else get("/boats") end end |
#destroy_boat(payload) ⇒ Object
23 24 25 |
# File 'lib/jibeset/client/boats.rb', line 23 def destroy_boat(payload) delete("/boats/#{payload[:id]}") end |
#update_boat(payload) ⇒ Object
19 20 21 |
# File 'lib/jibeset/client/boats.rb', line 19 def update_boat(payload) put("/boats/#{payload[:boat][:id]}", payload) end |