Skip to content

Commit

Permalink
change api namespace #2
Browse files Browse the repository at this point in the history
  • Loading branch information
fluxsaas committed Jul 16, 2015
1 parent 34aaa60 commit 7f0aff6
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions lib/staffomatic/client/absence_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions lib/staffomatic/client/absences.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/staffomatic/client/departments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/staffomatic/client/locations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/staffomatic/client/news_items.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
14 changes: 7 additions & 7 deletions lib/staffomatic/client/schedules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/staffomatic/client/shifts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/staffomatic/client/special_days.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions lib/staffomatic/client/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 7f0aff6

Please sign in to comment.