Skip to content

Commit f137d69

Browse files
committed
Create note resource
1 parent 4636a54 commit f137d69

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

lib/freeagent.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module FreeAgent
1212
require_relative 'freeagent/project'
1313
require_relative 'freeagent/task'
1414
require_relative 'freeagent/timeslip'
15+
require_relative 'freeagent/note'
1516
class << self
1617
attr_accessor :environment
1718
attr_accessor :debug

lib/freeagent/note.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module FreeAgent
2+
class Note < Resource
3+
resource :note
4+
5+
resource_methods :find, :filter, :update, :delete
6+
7+
attr_accessor :note, :parent_url, :author
8+
9+
date_accessor :created_at, :updated_at
10+
11+
# FIXME Need to change POST to allow query strings to be passed to it
12+
def self.create(attributes)
13+
raise FreeAgent::NotImplemented.new("FIXME Need to change POST to allow query strings to be passed to it")
14+
end
15+
16+
def self.find_all_by_contact(contact)
17+
Note.filter(:contact => contact)
18+
end
19+
20+
def self.find_all_by_project(project)
21+
Note.filter(:project => project)
22+
end
23+
end
24+
end

0 commit comments

Comments
 (0)