Module: WhenIWork::Client::Shifts
- Included in:
- WhenIWork::Client
- Defined in:
- lib/wheniwork/client/shifts.rb
Instance Method Summary collapse
- #create_shift(params = {}, options = {}) ⇒ Object
- #positions(params = {}, options = {}) ⇒ Object
- #shift(shift_id, params = {}, options = {}) ⇒ Object
- #shifts(params = {}, options = {}) ⇒ Object
- #shifts_by_criteria(start_date, end_date, params = {}, options = {}) ⇒ Object
- #shifts_by_users(user_ids, params = {}, options = {}) ⇒ Object
Instance Method Details
#create_shift(params = {}, options = {}) ⇒ Object
26 27 28 |
# File 'lib/wheniwork/client/shifts.rb', line 26 def create_shift(params = {}, = {}) post "shifts/", params, end |
#positions(params = {}, options = {}) ⇒ Object
4 5 6 |
# File 'lib/wheniwork/client/shifts.rb', line 4 def positions(params = {}, = {}) get 'positions', params, .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 = {}, = {}) get "shifts/#{shift_id}", params, end |
#shifts(params = {}, options = {}) ⇒ Object
14 15 16 |
# File 'lib/wheniwork/client/shifts.rb', line 14 def shifts(params = {}, = {}) get 'shifts', params, .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 = {}, = {}) get "shifts?start=#{start_date}&end=#{end_date}", params, .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 = {}, = {}) users_str = user_ids.join(',') get "shifts?user_id=#{users_str}", params, .merge(key: 'wheniwork_shifts') end |