blob: 204ff5dc2e4f176f231aa4fa071e78372725184c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  | 
class HCl 
  class DayEntry < TimesheetResource
    # Get the time sheet entries for a given day. If no date is provided
    # defaults to today.
    def self.all date = nil
      url = date.nil? ? 'daily' : "daily/#{date.strftime '%j/%Y'}"
      doc = REXML::Document.new perform url
      Task.cache_tasks doc
      doc.root.elements.collect('day_entries/day_entry') do |day|
        new xml_to_hash(day)
      end
    end
    def initialize *args
      super
      # TODO cache client/project names and ids
    end
  end
end
  |