Class: Tick::Project
Constant Summary collapse
- XML_PROPERTIES =
%w( id budget client_id client_name closed_on created_at name opened_on owner_id sum_hours updated_at user_count )
Instance Attribute Summary collapse
-
#budget ⇒ Object
Returns the value of attribute budget.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_name ⇒ Object
Returns the value of attribute client_name.
-
#closed_on ⇒ Object
Returns the value of attribute closed_on.
-
#name ⇒ Object
Returns the value of attribute name.
-
#opened_on ⇒ Object
Returns the value of attribute opened_on.
-
#owner_id ⇒ Object
Returns the value of attribute owner_id.
-
#sum_hours ⇒ Object
Returns the value of attribute sum_hours.
-
#tasks ⇒ Object
Returns the value of attribute tasks.
-
#user_count ⇒ Object
Returns the value of attribute user_count.
Attributes inherited from Base
#api_name, #api_path, #created_at, #id, #updated_at
Class Method Summary collapse
Methods inherited from Base
api_name, api_path, #set_properties_from_xml_node
Instance Attribute Details
#budget ⇒ Object
Returns the value of attribute budget.
4 5 6 |
# File 'lib/tick/project.rb', line 4 def budget @budget end |
#client_id ⇒ Object
Returns the value of attribute client_id.
4 5 6 |
# File 'lib/tick/project.rb', line 4 def client_id @client_id end |
#client_name ⇒ Object
Returns the value of attribute client_name.
4 5 6 |
# File 'lib/tick/project.rb', line 4 def client_name @client_name end |
#closed_on ⇒ Object
Returns the value of attribute closed_on.
4 5 6 |
# File 'lib/tick/project.rb', line 4 def closed_on @closed_on end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/tick/project.rb', line 4 def name @name end |
#opened_on ⇒ Object
Returns the value of attribute opened_on.
4 5 6 |
# File 'lib/tick/project.rb', line 4 def opened_on @opened_on end |
#owner_id ⇒ Object
Returns the value of attribute owner_id.
4 5 6 |
# File 'lib/tick/project.rb', line 4 def owner_id @owner_id end |
#sum_hours ⇒ Object
Returns the value of attribute sum_hours.
4 5 6 |
# File 'lib/tick/project.rb', line 4 def sum_hours @sum_hours end |
#tasks ⇒ Object
Returns the value of attribute tasks.
4 5 6 |
# File 'lib/tick/project.rb', line 4 def tasks @tasks end |
#user_count ⇒ Object
Returns the value of attribute user_count.
4 5 6 |
# File 'lib/tick/project.rb', line 4 def user_count @user_count end |
Class Method Details
.list(options = {}, &block) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/tick/project.rb', line 11 def self.list(={}, &block) url = "https://#{current_session.company}.tickspot.com/api/projects" params = authentication_params.merge!() request_manager.GET(url, parameters:params, success:lambda{|operation, result| projects = [] # Parse XML error = Pointer.new(:object) xml = GDataXMLDocument.alloc.initWithXMLString(result.to_s, error:error) # Create the project objects error = Pointer.new(:object) project_nodes = xml.nodesForXPath("//project", error:error) project_nodes.each do |project_node| project = new project.set_properties_from_xml_node(project_node) project.tasks = get_tasks_from_xml_node(project_node) project.tasks.each do |task| task.project = project end projects << project end block.call(projects) if block }, failure:lambda{|operation, error| block.call(error) if block }) self end |