class MypageTools::Shift

Data structure to represent a single shift on a single day

Attributes

date[RW]
day_of_week[RW]
start[RW]
stop[RW]

Public Class Methods

new(day_of_week=nil, date=nil, start=nil, stop=nil) click to toggle source
# File lib/mypage_tools/shift.rb, line 7
def initialize day_of_week=nil, date=nil, start=nil, stop=nil
        @day_of_week = day_of_week
        @date = date
        @start = start
        @stop = stop
end

Public Instance Methods

not_scheduled?() click to toggle source
# File lib/mypage_tools/shift.rb, line 26
def not_scheduled?
        @start == "00:00AM" && @stop == "00:00AM"
end
to_ical_event() click to toggle source
# File lib/mypage_tools/shift.rb, line 30
def to_ical_event
        event = Event.new
        event.start = DateTime.parse(self.date + " " + self.start + " PST")
        event.end = DateTime.parse(self.date + " " + self.stop + " PST")
        event.description = "Work at Apple"
        event.summary = "Work (Apple)"
        event.location = "Apple Store University Village, 2656 Northeast University Village Street, Seattle, WA, US"
        event
end