Skip to content

Commit

Permalink
Basic Invoice support
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Smith-Heisters committed May 17, 2009
1 parent 967b3b5 commit b2fd575
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/harvest/base.rb
Expand Up @@ -50,6 +50,11 @@ def tasks
Harvest::Resources::Task
end

# Invoices
def invoices
Harvest::Resources::Invoice
end

private

# Configure resource base class so that
Expand Down
13 changes: 13 additions & 0 deletions lib/harvest/resources/invoice.rb
@@ -0,0 +1,13 @@
module Harvest
module Resources
class Invoice < Harvest::HarvestResource
self.element_name = 'invoice'

class << self
def find_by_number number
find(find(:all).detect{|i|i.number == number}.id)
end
end
end
end
end

0 comments on commit b2fd575

Please sign in to comment.