Module: BookingSync::API::Client::Sources
- Included in:
- BookingSync::API::Client
- Defined in:
- lib/bookingsync/api/client/sources.rb
Instance Method Summary collapse
-
#create_source(options = {}) ⇒ BookingSync::API::Resource
Create a new source.
-
#edit_source(source, options = {}) ⇒ BookingSync::API::Resource
Edit a source.
-
#source(source, options = {}) ⇒ BookingSync::API::Resource
Get a single source.
-
#sources(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
List sources.
Instance Method Details
#create_source(options = {}) ⇒ BookingSync::API::Resource
Create a new source
36 37 38 |
# File 'lib/bookingsync/api/client/sources.rb', line 36 def create_source( = {}) post(:sources, sources: []).pop end |
#edit_source(source, options = {}) ⇒ BookingSync::API::Resource
Edit a source
ID of the source to be updated exception is raised otherwise
50 51 52 |
# File 'lib/bookingsync/api/client/sources.rb', line 50 def edit_source(source, = {}) put("sources/#{source}", sources: []).pop end |
#source(source, options = {}) ⇒ BookingSync::API::Resource
Get a single source
28 29 30 |
# File 'lib/bookingsync/api/client/sources.rb', line 28 def source(source, = {}) get("sources/#{source}", ).pop end |
#sources(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
List sources
Returns sources for the account user is authenticated with.
17 18 19 |
# File 'lib/bookingsync/api/client/sources.rb', line 17 def sources( = {}, &block) paginate :sources, , &block end |