Class: TaskMapper::Provider::Trac::Project
- Inherits:
-
Base::Project
- Object
- Base::Project
- TaskMapper::Provider::Trac::Project
- Defined in:
- lib/provider/project.rb
Overview
Project class for taskmapper-yoursystem
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
declare needed overloaded methods here.
-
#updated_at ⇒ Object
readonly
declare needed overloaded methods here.
Class Method Summary collapse
Instance Method Summary collapse
-
#copy(project) ⇒ Object
copy from this.copy(that) copies that into this.
- #id ⇒ Object
-
#initialize(*object) ⇒ Project
constructor
A new instance of Project.
- #ticket(*options) ⇒ Object
- #ticket!(*options) ⇒ Object
- #tickets(*options) ⇒ Object
Constructor Details
#initialize(*object) ⇒ Project
Returns a new instance of Project.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/provider/project.rb', line 10 def initialize(*object) if object.first object = object.first @system_data = {:client => object} unless object.is_a? Hash hash = {:repository => object.url, :owner => object.username, :name => object.name, :id => object.name} else hash = object end super hash end end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
declare needed overloaded methods here
9 10 11 |
# File 'lib/provider/project.rb', line 9 def created_at @created_at end |
#updated_at ⇒ Object (readonly)
declare needed overloaded methods here
9 10 11 |
# File 'lib/provider/project.rb', line 9 def updated_at @updated_at end |
Class Method Details
.find(*options) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/provider/project.rb', line 37 def self.find(*) mode = .first trac = TaskMapper::Provider::Trac.api if mode.is_a? String self.new({:url => trac[:url], :username => trac[:username], :name=> "#{trac[:username]}-project"}) end end |
Instance Method Details
#copy(project) ⇒ Object
copy from this.copy(that) copies that into this
27 28 29 30 31 32 33 34 35 |
# File 'lib/provider/project.rb', line 27 def copy(project) project.tickets.each do |ticket| copy_ticket = self.ticket!(:title => ticket.title, :description => ticket.description) ticket.comments.each do |comment| copy_ticket.comment!(:body => comment.body) sleep 1 end end end |
#id ⇒ Object
45 46 47 |
# File 'lib/provider/project.rb', line 45 def id 1 end |
#ticket(*options) ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/provider/project.rb', line 49 def ticket(*) unless .empty? = .first trac = TaskMapper::Provider::Trac.api if .is_a? Hash Ticket.find_by_id(trac[:trac].tickets.query().first, self[:name]) end else TaskMapper::Provider::Trac::Ticket end end |