Module: WhenIWork::Client::Shifts

Included in:
WhenIWork::Client
Defined in:
lib/wheniwork/client/shifts.rb

Instance Method Summary collapse

Instance Method Details

#create_shift(params = {}, options = {}) ⇒ Object



26
27
28
# File 'lib/wheniwork/client/shifts.rb', line 26

def create_shift(params = {}, options = {})
  post "shifts/", params, options
end

#positions(params = {}, options = {}) ⇒ Object



4
5
6
# File 'lib/wheniwork/client/shifts.rb', line 4

def positions(params = {}, options = {})
  get 'positions', params, options.merge(key: 'wheniwork_positions')
end

#shift(shift_id, params = {}, options = {}) ⇒ Object



22
23
24
# File 'lib/wheniwork/client/shifts.rb', line 22

def shift(shift_id, params = {}, options = {})
  get "shifts/#{shift_id}", params, options
end

#shifts(params = {}, options = {}) ⇒ Object



14
15
16
# File 'lib/wheniwork/client/shifts.rb', line 14

def shifts(params = {}, options = {})
  get 'shifts', params, options.merge(key: 'wheniwork_shifts')
end

#shifts_by_criteria(start_date, end_date, params = {}, options = {}) ⇒ Object



18
19
20
# File 'lib/wheniwork/client/shifts.rb', line 18

def shifts_by_criteria(start_date, end_date, params = {}, options = {})
  get "shifts?start=#{start_date}&end=#{end_date}", params, options.merge(key: 'wheniwork_shifts')
end

#shifts_by_users(user_ids, params = {}, options = {}) ⇒ Object



8
9
10
11
# File 'lib/wheniwork/client/shifts.rb', line 8

def shifts_by_users(user_ids, params = {}, options = {})
  users_str = user_ids.join(',')
  get "shifts?user_id=#{users_str}", params, options.merge(key: 'wheniwork_shifts')
end