Class: ShiftNote::DaysOfWeekShifts
- Inherits:
-
Object
- Object
- ShiftNote::DaysOfWeekShifts
- Defined in:
- lib/shiftnote/days_of_week_shifts.rb
Overview
The days of the week, their shifts.
Instance Method Summary collapse
-
#days ⇒ Array<DaysOfWeekShift>
The days in this week, whether working or not.
-
#initialize(data) ⇒ DaysOfWeekShifts
constructor
A new instance of DaysOfWeekShifts.
-
#raw ⇒ JSON
The raw data returned by ShiftNote.
-
#working_days ⇒ Array<DaysOfWeekShift>
Only the days this employee is working.
Constructor Details
#initialize(data) ⇒ DaysOfWeekShifts
Returns a new instance of DaysOfWeekShifts.
3 4 5 |
# File 'lib/shiftnote/days_of_week_shifts.rb', line 3 def initialize(data) @data = data end |
Instance Method Details
#days ⇒ Array<DaysOfWeekShift>
The days in this week, whether working or not.
9 10 11 12 13 14 15 |
# File 'lib/shiftnote/days_of_week_shifts.rb', line 9 def days dayz = [] @data.each do |e| dayz.push ShiftNote::DaysOfWeekShift.new(e) end dayz end |
#raw ⇒ JSON
Returns the raw data returned by ShiftNote.
27 28 29 |
# File 'lib/shiftnote/days_of_week_shifts.rb', line 27 def raw @data end |
#working_days ⇒ Array<DaysOfWeekShift>
Returns only the days this employee is working.
18 19 20 21 22 23 24 |
# File 'lib/shiftnote/days_of_week_shifts.rb', line 18 def working_days dayz = [] @data.each do |e| dayz.push ShiftNote::DaysOfWeekShift.new(e) unless e['Shifts'].empty? end dayz end |