Skip to content

Commit

Permalink
Documenting tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
zmoazeni committed Apr 22, 2010
1 parent 1fbeef9 commit fe4913e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/harvest/base.rb
Expand Up @@ -103,6 +103,25 @@ def projects
@projects ||= Harvest::API::Projects.new(credentials)
end

# All API Actions surrounding Tasks
#
# == Examples
# harvest.tasks.all() # Returns all tasks in the system
#
# harvest.tasks.find(100) # Returns the task with id = 100
#
# task = Harvest::Task.new(:name => 'Server Administration' :default => true)
# saved_task = harvest.tasks.create(task) # returns a saved version of Harvest::Task
#
# task = harvest.tasks.find(205)
# task.name = 'Server Administration'
# updated_task = harvest.tasks.update(task) # returns an updated version of Harvest::Task
#
# task = harvest.task.find(205)
# harvest.tasks.delete(task) # returns 205
#
# @see Harvest::Behavior::Crud
# @return [Harvest::API::Tasks]
def tasks
@tasks ||= Harvest::API::Tasks.new(credentials)
end
Expand Down
10 changes: 10 additions & 0 deletions lib/harvest/task.rb
@@ -1,4 +1,14 @@
module Harvest

# The model that contains information about a task
#
# == Fields
# [+id+] the id of the task
# [+name+] (REQUIRED) the name of the task
# [+billable+] whether the task is billable by default
# [+deactivated+] whether the task is deactivated
# [+hourly_rate+] what the default hourly rate for the task is
# [+default?+] whether to add this task to new projects by default
class Task < BaseModel
include HappyMapper

Expand Down

0 comments on commit fe4913e

Please sign in to comment.