Class: TicketMaster::Provider::Mingle::Project
- Inherits:
-
Base::Project
- Object
- Base::Project
- TicketMaster::Provider::Mingle::Project
- Defined in:
- lib/provider/project.rb
Overview
Project class for ticketmaster-mingle
Constant Summary collapse
Instance Method Summary collapse
-
#copy(project) ⇒ Object
copy from this.copy(that) copies that into this.
-
#id ⇒ Object
declare needed overloaded methods here.
-
#initialize(*options) ⇒ Project
constructor
A new instance of Project.
- #ticket!(*options) ⇒ Object
- #tickets(*options) ⇒ Object
Constructor Details
#initialize(*options) ⇒ Project
Returns a new instance of Project.
14 15 16 |
# File 'lib/provider/project.rb', line 14 def initialize(*) super(*) end |
Instance Method Details
#copy(project) ⇒ Object
copy from this.copy(that) copies that into this
39 40 41 42 43 44 45 46 47 |
# File 'lib/provider/project.rb', line 39 def copy(project) project.tickets.each do |ticket| copy_ticket = self.ticket!(:name => ticket.title, :description => ticket.description) ticket.comments.each do |comment| copy_ticket.comment!(:content => comment.body) sleep 1 end end end |
#id ⇒ Object
declare needed overloaded methods here
10 11 12 |
# File 'lib/provider/project.rb', line 10 def id self[:identifier] end |
#ticket!(*options) ⇒ Object
33 34 35 36 |
# File 'lib/provider/project.rb', line 33 def ticket!(*) [0].merge!(:identifier => id) if .first.is_a?(Hash) provider_parent(self.class)::Ticket.create(*) end |
#tickets(*options) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/provider/project.rb', line 18 def tickets(*) begin if .first.is_a? Hash #options[0].merge!(:params => {:id => id}) super(*) elsif .empty? tickets = MingleAPI::Card.find(:all, :params => {:identifier => id}).collect { |ticket| TicketMaster::Provider::Mingle::Ticket.new ticket } else super(*) end rescue [] end end |