From 7f0aff62d4e43a6990e946cbea3ff3bc74b82f7c Mon Sep 17 00:00:00 2001 From: kalle saas Date: Thu, 16 Jul 2015 16:02:39 +0200 Subject: [PATCH] change api namespace #2 --- lib/staffomatic/client/absence_types.rb | 4 ++-- lib/staffomatic/client/absences.rb | 8 ++++---- lib/staffomatic/client/departments.rb | 4 ++-- lib/staffomatic/client/locations.rb | 4 ++-- lib/staffomatic/client/news_items.rb | 4 ++-- lib/staffomatic/client/schedules.rb | 14 +++++++------- lib/staffomatic/client/shifts.rb | 4 ++-- lib/staffomatic/client/special_days.rb | 4 ++-- lib/staffomatic/client/users.rb | 8 ++++---- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/lib/staffomatic/client/absence_types.rb b/lib/staffomatic/client/absence_types.rb index cb24645..39b92da 100644 --- a/lib/staffomatic/client/absence_types.rb +++ b/lib/staffomatic/client/absence_types.rb @@ -52,7 +52,7 @@ def absence_type(absence_type_id, options = {}) # @example # Staffomatic.update_absence_types(:name => "Erik Michaels-Ober") def update_absence_type(absence_type_id, options) - patch "absence_types/#{absence_type_id}", :absence_type => options + patch "absence_types/#{absence_type_id}", options end # Create a absence_type @@ -63,7 +63,7 @@ def update_absence_type(absence_type_id, options) # @example Create a new Location # Octokit.create_absence_types() def create_absence_type(location_id, options) - post "locations/#{location_id}/absence_types", :absence_type => options + post "locations/#{location_id}/absence_types", options end # Delete a single absence_type diff --git a/lib/staffomatic/client/absences.rb b/lib/staffomatic/client/absences.rb index e026332..daad58c 100644 --- a/lib/staffomatic/client/absences.rb +++ b/lib/staffomatic/client/absences.rb @@ -52,7 +52,7 @@ def absence(absence_id, options = {}) # @example # Staffomatic.update_absences(:name => "Erik Michaels-Ober") def update_absence(absence_id, options) - patch "absences/#{absence_id}", :absence => options + patch "absences/#{absence_id}", options end # Approve! a absence @@ -64,7 +64,7 @@ def update_absence(absence_id, options) # @example # Staffomatic.publish_absence(123) def approve_absence(absence_id, options = {}) - patch "absences/#{absence_id}", :absence => options.merge({:do => 'approve'}) + patch "absences/#{absence_id}", options.merge({:do => 'approve'}) end # Decline! a absence @@ -76,7 +76,7 @@ def approve_absence(absence_id, options = {}) # @example # Staffomatic.publish_absence(123) def decline_absence(absence_id, options = {}) - patch "absences/#{absence_id}", :absence => options.merge({:do => 'decline'}) + patch "absences/#{absence_id}", options.merge({:do => 'decline'}) end # Create absence @@ -87,7 +87,7 @@ def decline_absence(absence_id, options = {}) # @example Create a new Location # Octokit.create_absences() def create_absence(options = {}) - post "absences", :absence => options + post "absences", options end # Delete a single absence diff --git a/lib/staffomatic/client/departments.rb b/lib/staffomatic/client/departments.rb index a0ef998..c391c1a 100644 --- a/lib/staffomatic/client/departments.rb +++ b/lib/staffomatic/client/departments.rb @@ -52,7 +52,7 @@ def department(department_id, options = {}) # @example # Staffomatic.update_departments(:name => "Erik Michaels-Ober") def update_department(department_id, options) - patch "departments/#{department_id}", :department => options + patch "departments/#{department_id}", options end # Create a department @@ -63,7 +63,7 @@ def update_department(department_id, options) # @example Create a new Location # Octokit.create_departments() def create_department(location_id, options) - post "locations/#{location_id}/departments", :department => options + post "locations/#{location_id}/departments", options end # Delete a single department diff --git a/lib/staffomatic/client/locations.rb b/lib/staffomatic/client/locations.rb index 6b8632e..183086f 100644 --- a/lib/staffomatic/client/locations.rb +++ b/lib/staffomatic/client/locations.rb @@ -41,7 +41,7 @@ def location(location_id, options = {}) # @example # Staffomatic.update_locations(:name => "Erik Michaels-Ober") def update_location(location_id, options) - patch "locations/#{location_id}", :location => options + patch "locations/#{location_id}", options end # Create a location @@ -52,7 +52,7 @@ def update_location(location_id, options) # @example Create a new Location # Octokit.create_locations() def create_location(name, options = {}) - post "locations", :location => options.merge({:name => name}) + post "locations", options.merge({:name => name}) end # Delete a single location diff --git a/lib/staffomatic/client/news_items.rb b/lib/staffomatic/client/news_items.rb index 071f8e1..b3032e5 100644 --- a/lib/staffomatic/client/news_items.rb +++ b/lib/staffomatic/client/news_items.rb @@ -52,7 +52,7 @@ def news_item(news_item_id, options = {}) # @example # Staffomatic.update_news_items(:name => "Erik Michaels-Ober") def update_news_item(news_item_id, options) - patch "news_items/#{news_item_id}", :news_item => options + patch "news_items/#{news_item_id}", options end # Create a news_item @@ -63,7 +63,7 @@ def update_news_item(news_item_id, options) # @example Create a new Location # Octokit.create_news_items() def create_news_item(location_id, options) - post "locations/#{location_id}/news_items", :news_item => options + post "locations/#{location_id}/news_items", options end # Delete a single news_item diff --git a/lib/staffomatic/client/schedules.rb b/lib/staffomatic/client/schedules.rb index 5fb3d36..fd8a8eb 100644 --- a/lib/staffomatic/client/schedules.rb +++ b/lib/staffomatic/client/schedules.rb @@ -52,7 +52,7 @@ def schedule(schedule_id, options = {}) # @example # Staffomatic.update_schedules(:name => "Erik Michaels-Ober") def update_schedule(schedule_id, options) - patch "schedules/#{schedule_id}", :schedule => options + patch "schedules/#{schedule_id}", options end # Publish a schedule @@ -64,7 +64,7 @@ def update_schedule(schedule_id, options) # @example # Staffomatic.publish_schedule(123) def publish_schedule(schedule_id, options = {}) - patch "schedules/#{schedule_id}", :schedule => options.merge({:do => 'publish'}) + patch "schedules/#{schedule_id}", options.merge({:do => 'publish'}) end # Republish a schedule @@ -76,7 +76,7 @@ def publish_schedule(schedule_id, options = {}) # @example # Staffomatic.publish_schedule(123) def republish_schedule(schedule_id, options = {}) - patch "schedules/#{schedule_id}", :schedule => options.merge({:do => 'republish'}) + patch "schedules/#{schedule_id}", options.merge({:do => 'republish'}) end # Bulk delete schedule shifts @@ -89,7 +89,7 @@ def republish_schedule(schedule_id, options = {}) # @example # Staffomatic.publish_schedule(123) def bulk_delete_schedule_shifts(schedule_id, department_ids = [], options = {}) - patch "schedules/#{schedule_id}", :schedule => options.merge({:do => 'bulk_destroy', :department_ids => department_ids}) + patch "schedules/#{schedule_id}", options.merge({:do => 'bulk_destroy', :department_ids => department_ids}) end # Import shifts from another schedule @@ -103,7 +103,7 @@ def bulk_delete_schedule_shifts(schedule_id, department_ids = [], options = {}) # @example # Staffomatic.publish_schedule(123) def import_shifts_from_schedule(schedule_id, import_schedule_id, import_assignments = false, department_ids = [], options = {}) - patch "schedules/#{schedule_id}", :schedule => options.merge({:do => 'import_shifts', :import_schedule_id => import_schedule_id, :import_assignments => import_assignments, :department_ids => department_ids}) + patch "schedules/#{schedule_id}", options.merge({:do => 'import_shifts', :import_schedule_id => import_schedule_id, :import_assignments => import_assignments, :department_ids => department_ids}) end # Accepts applications in schedule @@ -118,7 +118,7 @@ def import_shifts_from_schedule(schedule_id, import_schedule_id, import_assignme # @example # Staffomatic.publish_schedule(123) def accept_applications_in_schedule(schedule_id, respect_max_hours_per_month, department_ids = [], user_ids = [], options = {}) - patch "schedules/#{schedule_id}", :schedule => options.merge({:do => 'bulk_accept', + patch "schedules/#{schedule_id}", options.merge({:do => 'bulk_accept', :respect_max_hours_per_month => respect_max_hours_per_month, :department_ids => department_ids, :user_ids => user_ids @@ -133,7 +133,7 @@ def accept_applications_in_schedule(schedule_id, respect_max_hours_per_month, de # @example Create a new Location # Octokit.create_schedules() def create_schedule(location_id, options) - post "locations/#{location_id}/schedules", :schedule => options + post "locations/#{location_id}/schedules", options end # Delete a single schedule diff --git a/lib/staffomatic/client/shifts.rb b/lib/staffomatic/client/shifts.rb index 93d701b..d06e342 100644 --- a/lib/staffomatic/client/shifts.rb +++ b/lib/staffomatic/client/shifts.rb @@ -64,7 +64,7 @@ def shift(shift_id, options = {}) # @example # Staffomatic.update_shifts(:name => "Erik Michaels-Ober") def update_shift(shift_id, options) - patch "shifts/#{shift_id}", :shift => options + patch "shifts/#{shift_id}", options end # Create a shift @@ -75,7 +75,7 @@ def update_shift(shift_id, options) # @example Create a new Location # Octokit.create_shifts() def create_shift(schedule_id, department_id, options) - post "schedules/#{schedule_id}/shifts", :shift => options.merge(:department_id => department_id) + post "schedules/#{schedule_id}/shifts", options.merge(:department_id => department_id) end # Delete a single shift diff --git a/lib/staffomatic/client/special_days.rb b/lib/staffomatic/client/special_days.rb index f786579..7ee5e23 100644 --- a/lib/staffomatic/client/special_days.rb +++ b/lib/staffomatic/client/special_days.rb @@ -52,7 +52,7 @@ def special_day(special_day_id, options = {}) # @example # Staffomatic.update_special_days(:name => "Erik Michaels-Ober") def update_special_day(special_day_id, options) - patch "special_days/#{special_day_id}", :special_day => options + patch "special_days/#{special_day_id}", options end # Create a special_day @@ -63,7 +63,7 @@ def update_special_day(special_day_id, options) # @example Create a new Location # Octokit.create_special_days() def create_special_day(location_id, options) - post "locations/#{location_id}/special_days", :special_day => options + post "locations/#{location_id}/special_days", options end # Delete a single special_day diff --git a/lib/staffomatic/client/users.rb b/lib/staffomatic/client/users.rb index 0de8765..233e787 100644 --- a/lib/staffomatic/client/users.rb +++ b/lib/staffomatic/client/users.rb @@ -101,7 +101,7 @@ def update_user(user_id, options) # @example # Staffomatic.lock_user(493) def lock_user(user_id) - patch "users/#{user_id}", :user => {:do => 'lock'} + patch "users/#{user_id}", {:do => 'lock'} end # Unlock Access for user @@ -112,7 +112,7 @@ def lock_user(user_id) # @example # Staffomatic.lock_user(493) def unlock_user(user_id) - patch "users/#{user_id}", :user => {:do => 'unlock'} + patch "users/#{user_id}", {:do => 'unlock'} end # Invite a user @@ -122,7 +122,7 @@ def unlock_user(user_id) # @example Create a new Location # Octokit.create_users() def invite_user(options) - post "users", :user => options.merge({:do => 'send_invitation'}) + post "users", options.merge({:do => 'send_invitation'}) end # Create a user @@ -132,7 +132,7 @@ def invite_user(options) # @example Create a new Location # Octokit.create_users() def create_user(options) - post "users", :user => options + post "users", options end # Delete a single user