Class: Pike13::API::V2::Front::Booking

Inherits:
Base
  • Object
show all
Defined in:
lib/pike13/api/v2/front/booking.rb

Class Method Summary collapse

Methods inherited from Base

client, configure

Class Method Details

.create(attributes) ⇒ Object

POST /front/bookings



20
21
22
# File 'lib/pike13/api/v2/front/booking.rb', line 20

def create(attributes)
  client.post("front/bookings", { booking: attributes })
end

.create_lease(booking_id, attributes) ⇒ Object

POST /front/bookings/:booking_id/leases



35
36
37
# File 'lib/pike13/api/v2/front/booking.rb', line 35

def create_lease(booking_id, attributes)
  client.post("front/bookings/#{booking_id}/leases", { lease: attributes })
end

.destroy(id) ⇒ Object

DELETE /front/bookings/:id



30
31
32
# File 'lib/pike13/api/v2/front/booking.rb', line 30

def destroy(id)
  client.delete("front/bookings/#{id}")
end

.destroy_lease(booking_id, lease_id) ⇒ Object

DELETE /front/bookings/:booking_id/leases/:lease_id



45
46
47
# File 'lib/pike13/api/v2/front/booking.rb', line 45

def destroy_lease(booking_id, lease_id)
  client.delete("front/bookings/#{booking_id}/leases/#{lease_id}")
end

.find(id) ⇒ Object

GET /front/bookings/:id



10
11
12
# File 'lib/pike13/api/v2/front/booking.rb', line 10

def find(id)
  client.get("front/bookings/#{id}")
end

.find_lease(booking_id:, id:, **params) ⇒ Object

GET /front/bookings/:booking_id/leases/:id



15
16
17
# File 'lib/pike13/api/v2/front/booking.rb', line 15

def find_lease(booking_id:, id:, **params)
  client.get("front/bookings/#{booking_id}/leases/#{id}", params)
end

.update(id, attributes) ⇒ Object

PUT /front/bookings/:id



25
26
27
# File 'lib/pike13/api/v2/front/booking.rb', line 25

def update(id, attributes)
  client.put("front/bookings/#{id}", { booking: attributes })
end

.update_lease(booking_id, id, attributes) ⇒ Object

PUT /front/bookings/:booking_id/leases/:id



40
41
42
# File 'lib/pike13/api/v2/front/booking.rb', line 40

def update_lease(booking_id, id, attributes)
  client.put("front/bookings/#{booking_id}/leases/#{id}", { lease: attributes })
end