Class: TicketMaster::Provider::Pivotal::Project
- Inherits:
-
Base::Project
- Object
- Base::Project
- TicketMaster::Provider::Pivotal::Project
- Defined in:
- lib/provider/project.rb
Overview
Project class for ticketmaster-pivotal
Constant Summary collapse
- API =
PivotalAPI::Project
Instance Attribute Summary collapse
-
#prefix_options ⇒ Object
The finder method.
Instance Method Summary collapse
-
#copy(project) ⇒ Object
copy from.
-
#destroy ⇒ Object
Delete this project.
-
#initialize(*options) ⇒ Project
constructor
A new instance of Project.
-
#save ⇒ Object
Save this project.
- #ticket!(*options) ⇒ Object
Constructor Details
#initialize(*options) ⇒ Project
Returns a new instance of Project.
26 27 28 29 |
# File 'lib/provider/project.rb', line 26 def initialize(*) super(*) self.id = self.id.to_i end |
Instance Attribute Details
#prefix_options ⇒ Object
The finder method
It accepts all the find functionalities defined by ticketmaster
+ find() and find(:all) - Returns all projects on the account + find(<project_id>) - Returns the project based on the id + find(:first, :name => <project_name>) - Returns the first project based on the attribute + find(:name => <project name>) - Returns all projects based on the attribute
16 17 18 |
# File 'lib/provider/project.rb', line 16 def @prefix_options end |
Instance Method Details
#copy(project) ⇒ Object
copy from
43 44 45 46 47 48 49 50 51 |
# File 'lib/provider/project.rb', line 43 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!(:text => comment.body) sleep 1 end end end |
#destroy ⇒ Object
Delete this project
32 33 34 35 |
# File 'lib/provider/project.rb', line 32 def destroy result = self.system_data[:client].destroy result.is_a?(Net::HTTPOK) end |
#save ⇒ Object
Save this project
21 22 23 24 |
# File 'lib/provider/project.rb', line 21 def save warn 'Warning: Pivotal does not allow editing of project attributes. This method does nothing.' true end |