Class: LiquidPlanner::Resources::Item
Instance Method Summary
collapse
#load
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class LiquidPlanner::LiquidPlannerResource
Instance Method Details
#attach_document(attached_file_path, options = {}) ⇒ Object
32
33
34
35
36
|
# File 'lib/liquidplanner/resources/item.rb', line 32
def attach_document( attached_file_path, options={} )
doc = Document.upload_document( workspace_id, id, attached_file_path, options )
doc.prefix_options = luggage_params
doc
end
|
24
25
26
|
# File 'lib/liquidplanner/resources/item.rb', line 24
def ( scope=:all )
Comment.find( scope, :params => luggage_params )
end
|
#documents(scope = :all) ⇒ Object
28
29
30
|
# File 'lib/liquidplanner/resources/item.rb', line 28
def documents( scope=:all )
Document.find( scope, :params => luggage_params )
end
|
#estimates(scope = :all) ⇒ Object
42
43
44
|
# File 'lib/liquidplanner/resources/item.rb', line 42
def estimates( scope=:all )
Estimate.find( scope, :params => luggage_params )
end
|
#folder ⇒ Object
10
11
12
|
# File 'lib/liquidplanner/resources/item.rb', line 10
def folder
Folder.find( :one, :from => "/api/workspaces/#{workspace_id}/folders/#{folder_id}" )
end
|
#item_collection ⇒ Object
LiquidPlanner::Item => ‘items’
47
48
49
|
# File 'lib/liquidplanner/resources/item.rb', line 47
def item_collection
self.class.to_s.split('::').last.downcase.pluralize
end
|
#links(scope = :all) ⇒ Object
38
39
40
|
# File 'lib/liquidplanner/resources/item.rb', line 38
def links( scope=:all )
Link.find( scope, :params => luggage_params )
end
|
#note ⇒ Object
18
19
20
21
22
|
# File 'lib/liquidplanner/resources/item.rb', line 18
def note
Note.find( :one, :from => "/api/workspaces/#{workspace_id}/#{item_collection}/#{id}/note" ).tap do |n|
n.prefix_options = luggage_params
end
end
|
#tasklist ⇒ Object
14
15
16
|
# File 'lib/liquidplanner/resources/item.rb', line 14
def tasklist
Tasklist.find( :one, :from => "/api/workspaces/#{workspace_id}/tasklists/#{tasklist_id}" )
end
|
#workspace_id ⇒ Object
51
52
53
|
# File 'lib/liquidplanner/resources/item.rb', line 51
def workspace_id
prefix_options[:workspace_id]
end
|