Class: TicketMaster::Provider::Redmine::Project

Inherits:
Base::Project
  • Object
show all
Defined in:
lib/provider/project.rb

Overview

Project class for ticketmaster-yoursystem

Constant Summary collapse

API =

declare needed overloaded methods here

RedmineAPI::Project

Instance Method Summary collapse

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
25
26
# File 'lib/provider/project.rb', line 10

def initialize(*object) 
  if object.first
    object = object.first
    unless object.is_a? Hash
      hash = {:id => object.id,
              :name => object.name,
              :description => object.description,
              :identifier => object.identifier,
              :created_at => object.created_on,
              :updated_at => object.updated_on}

    else
      hash = object
    end
    super hash
  end
end

Instance Method Details

#copy(project) ⇒ Object

copy from this.copy(that) copies that into this



29
30
31
32
33
34
35
36
37
# File 'lib/provider/project.rb', line 29

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

#idObject



39
40
41
# File 'lib/provider/project.rb', line 39

def id
  self[:id]
end

#identifierObject



43
44
45
# File 'lib/provider/project.rb', line 43

def identifier
  self[:identifier]
end