Class: ShiftNote::ScheduleThisWeek
- Inherits:
-
Object
- Object
- ShiftNote::ScheduleThisWeek
- Defined in:
- lib/shiftnote/schedule_this_week.rb
Overview
The schedule for this week.
Instance Attribute Summary collapse
-
#cost ⇒ Float
readonly
The cost is simply hours * rate.
-
#end_date ⇒ Time
readonly
The end date of the schedule.
-
#hours ⇒ Float
readonly
The total hours this employee is working this schedule.
-
#raw ⇒ JSON
readonly
The raw data returned by ShiftNote.
-
#schedule ⇒ ShiftNote::DaysOfWeekShifts
readonly
The schedule for this week.
-
#shifts ⇒ Float
readonly
The amount of shifts this person has this week.
-
#start_date ⇒ Time
readonly
The start date of the schedule.
Instance Method Summary collapse
-
#initialize(data) ⇒ ScheduleThisWeek
constructor
A new instance of ScheduleThisWeek.
Constructor Details
#initialize(data) ⇒ ScheduleThisWeek
Returns a new instance of ScheduleThisWeek.
3 4 5 6 7 8 9 10 11 |
# File 'lib/shiftnote/schedule_this_week.rb', line 3 def initialize(data) @raw = data @start_date = Time.parse(data['StartDate']) @end_date = Time.parse(data['EndDate']) @hours = data['Hours'] @cost = data['Cost'] @shifts = data['Shifts'] @schedule = ShiftNote::DaysOfWeekShifts.new(data['DaysOfWeekShifts']) end |
Instance Attribute Details
#cost ⇒ Float (readonly)
The cost is simply hours * rate.
24 25 26 |
# File 'lib/shiftnote/schedule_this_week.rb', line 24 def cost @cost end |
#end_date ⇒ Time (readonly)
Returns the end date of the schedule.
17 18 19 |
# File 'lib/shiftnote/schedule_this_week.rb', line 17 def end_date @end_date end |
#hours ⇒ Float (readonly)
Returns the total hours this employee is working this schedule.
20 21 22 |
# File 'lib/shiftnote/schedule_this_week.rb', line 20 def hours @hours end |
#raw ⇒ JSON (readonly)
Returns the raw data returned by ShiftNote.
33 34 35 |
# File 'lib/shiftnote/schedule_this_week.rb', line 33 def raw @raw end |
#schedule ⇒ ShiftNote::DaysOfWeekShifts (readonly)
Returns the schedule for this week.
30 31 32 |
# File 'lib/shiftnote/schedule_this_week.rb', line 30 def schedule @schedule end |
#shifts ⇒ Float (readonly)
Returns the amount of shifts this person has this week.
27 28 29 |
# File 'lib/shiftnote/schedule_this_week.rb', line 27 def shifts @shifts end |
#start_date ⇒ Time (readonly)
Returns the start date of the schedule.
14 15 16 |
# File 'lib/shiftnote/schedule_this_week.rb', line 14 def start_date @start_date end |