Module: BookingSync::API::Client::Attachments
- Included in:
- BookingSync::API::Client
- Defined in:
- lib/bookingsync/api/client/attachments.rb
Instance Method Summary collapse
-
#attachment(attachment) ⇒ BookingSync::API::Resource
Get a single attachment.
-
#attachments(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
List attachments.
-
#create_attachment(options = {}) ⇒ BookingSync::API::Resource
Create a new attachment.
-
#edit_attachment(attachment, options = {}) ⇒ BookingSync::API::Resource
Edit a attachment.
Instance Method Details
#attachment(attachment) ⇒ BookingSync::API::Resource
Get a single attachment
24 25 26 |
# File 'lib/bookingsync/api/client/attachments.rb', line 24 def () get("inbox/attachments/#{}").pop end |
#attachments(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
List attachments
Returns attachments for the account user is authenticated with.
15 16 17 |
# File 'lib/bookingsync/api/client/attachments.rb', line 15 def ( = {}, &block) paginate "inbox/attachments", , &block end |
#create_attachment(options = {}) ⇒ BookingSync::API::Resource
Create a new attachment
32 33 34 35 36 37 |
# File 'lib/bookingsync/api/client/attachments.rb', line 32 def ( = {}) if file_path = .delete(:file_path) [:file] ||= base_64_encode(file_path) end post("inbox/attachments", attachments: []).pop end |
#edit_attachment(attachment, options = {}) ⇒ BookingSync::API::Resource
Edit a attachment
49 50 51 52 53 54 |
# File 'lib/bookingsync/api/client/attachments.rb', line 49 def (, = {}) if file_path = .delete(:file_path) [:file] ||= base_64_encode(file_path) end put("inbox/attachments/#{}", attachments: []).pop end |