class Overtimer::Workweek

Public Class Methods

max_regular() click to toggle source
# File lib/overtimer/workweek.rb, line 18
def self.max_regular
  40
end
new(days) click to toggle source
Calls superclass method Overtimer::Workbase::new
# File lib/overtimer/workweek.rb, line 22
def initialize days
  super
  @days = days.map!{|i| Workday.new(i) }

  if defined? ALEX_DOUBLE_TIME
    if days.reject{|i| i.total == 0}.size == 7
      @total += @doubletime += days.pop.total
    end
  end

  days.each do |day|
    account_for_hours day.total
    self.doubletime += day.doubletime
    self.overtime -= day.doubletime
  end
end

Public Instance Methods

[](index) click to toggle source
# File lib/overtimer/workweek.rb, line 39
def [] index
  @days[index]
end