Module: BookingSync::API::Client::Photos
- Included in:
- BookingSync::API::Client
- Defined in:
- lib/bookingsync/api/client/photos.rb
Instance Method Summary collapse
-
#create_photo(rental, options = {}) ⇒ BookingSync::API::Resource
Create a photo.
-
#delete_photo(photo) ⇒ NilClass
Delete a photo.
-
#edit_photo(photo, options = {}) ⇒ BookingSync::API::Resource
Edit a photo.
-
#photos(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
List photos.
Instance Method Details
#create_photo(rental, options = {}) ⇒ BookingSync::API::Resource
Create a photo
37 38 39 40 41 42 |
# File 'lib/bookingsync/api/client/photos.rb', line 37 def create_photo(rental, = {}) if photo_path = .delete(:photo_path) [:photo] ||= encode(photo_path) end post("rentals/#{rental}/photos", photos: []).pop end |
#delete_photo(photo) ⇒ NilClass
Delete a photo
64 65 66 |
# File 'lib/bookingsync/api/client/photos.rb', line 64 def delete_photo(photo) delete "photos/#{photo}" end |
#edit_photo(photo, options = {}) ⇒ BookingSync::API::Resource
Edit a photo
51 52 53 54 55 56 |
# File 'lib/bookingsync/api/client/photos.rb', line 51 def edit_photo(photo, = {}) if photo_path = .delete(:photo_path) [:photo] ||= encode(photo_path) end put("photos/#{photo}", photos: []).pop end |
#photos(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
List photos
Returns photos for the account user is authenticated with.
19 20 21 |
# File 'lib/bookingsync/api/client/photos.rb', line 19 def photos( = {}, &block) paginate :photos, , &block end |