Class: Harvest::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/harvest/base.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Requires a sub_domain, email, and password. Specifying headers is optional, but useful for setting a user agent.



6
7
8
9
10
11
12
13
14
# File 'lib/harvest/base.rb', line 6

def initialize(options={})
  options.assert_valid_keys(:email, :password, :sub_domain, :headers)
  options.assert_required_keys(:email, :password, :sub_domain)
  @email        = options[:email]
  @password     = options[:password]
  @sub_domain   = options[:sub_domain]
  @headers      = options[:headers]
  configure_base_resource
end

Instance Method Details

#clientsObject

Clients



20
21
22
# File 'lib/harvest/base.rb', line 20

def clients
  Harvest::Resources::Client
end

#expense_categoriesObject

Expense categories.



30
31
32
# File 'lib/harvest/base.rb', line 30

def expense_categories
  Harvest::Resources::ExpenseCategory
end

#expensesObject

Expenses.



25
26
27
# File 'lib/harvest/base.rb', line 25

def expenses
  Harvest::Resources::Expense
end

#peopleObject

People. Also provides access to time entries.



36
37
38
# File 'lib/harvest/base.rb', line 36

def people
  Harvest::Resources::Person
end

#projectsObject

Projects. Provides access to the assigned users and tasks along with reports for entries on the project.



43
44
45
# File 'lib/harvest/base.rb', line 43

def projects
  Harvest::Resources::Project
end

#tasksObject

Tasks.



48
49
50
# File 'lib/harvest/base.rb', line 48

def tasks
  Harvest::Resources::Task
end