Sha256: 26ae77e768c25a333fd15a92e285da85fd49b408db9616d9190c21104b5ce808

Contents?: true

Size: 486 Bytes

Versions: 16

Compression:

Stored size: 486 Bytes

Contents

module TaskManager
  class DoneTaskFile < TaskFile
    DEFAULT_NO_RESULTS = 15

    def all
      super.reverse!.first(DEFAULT_NO_RESULTS)
    end

    protected

    def root_node
      @root_node ||= begin
        xml.css(DONE_NODE).first || begin
          node = xml.create_element(DONE_NODE)
          super.add_child(node)
          node
        end
      end
    end

    def create_node(task)
      node = super
      node['finished_at'] = time_now
      node
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
task_manager2-0.0.16 lib/task_manager/done_task_file.rb
task_manager2-0.0.15 lib/task_manager/done_task_file.rb
task_manager2-0.0.14 lib/task_manager/done_task_file.rb
task_manager2-0.0.13 lib/task_manager/done_task_file.rb
task_manager2-0.0.12 lib/task_manager/done_task_file.rb
task_manager2-0.0.11 lib/task_manager/done_task_file.rb
task_manager2-0.0.10 lib/task_manager/done_task_file.rb
task_manager2-0.0.9 lib/task_manager/done_task_file.rb
task_manager2-0.0.8 lib/task_manager/done_task_file.rb
task_manager2-0.0.7 lib/task_manager/done_task_file.rb
task_manager2-0.0.6 lib/task_manager/done_task_file.rb
task_manager2-0.0.5 lib/task_manager/done_task_file.rb
task_manager2-0.0.4 lib/task_manager/done_task_file.rb
task_manager2-0.0.3 lib/task_manager/done_task_file.rb
task_manager2-0.0.2 lib/task_manager/done_task_file.rb
task_manager2-0.0.1 lib/task_manager/done_task_file.rb