Class: TaskMapper::Provider::Zendesk::Project
- Inherits:
-
Base::Project
- Object
- Base::Project
- TaskMapper::Provider::Zendesk::Project
- Defined in:
- lib/provider/project.rb
Overview
Project class for taskmapper-zendesk
Instance Attribute Summary collapse
-
#prefix_options ⇒ Object
Returns the value of attribute prefix_options.
Instance Method Summary collapse
-
#copy(project) ⇒ Object
copy from this.copy(that) copies that into this.
-
#initialize(*object) ⇒ Project
constructor
API = ZendeskAPI::Organization declare needed overloaded methods here.
- #ticket(*options) ⇒ Object
- #ticket!(*options) ⇒ Object
Constructor Details
#initialize(*object) ⇒ Project
API = ZendeskAPI::Organization declare needed overloaded methods here
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/provider/project.rb', line 11 def initialize(*object) if object.first object = object.first unless object.is_a? Hash @system_data = {:client => object} hash = {:repository => object.account, :user => object.username, :name => object.name} else hash = object end super hash end end |
Instance Attribute Details
#prefix_options ⇒ Object
Returns the value of attribute prefix_options.
7 8 9 |
# File 'lib/provider/project.rb', line 7 def @prefix_options 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 |
#ticket(*options) ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/provider/project.rb', line 37 def ticket(*) if .first.is_a? Fixnum ticket_id = .first Ticket.find_by_id(self.name, ticket_id) elsif .first.is_a? Hash Ticket.find_by_attributes(self.name, .first).first else TaskMapper::Provider::Zendesk::Ticket end end |