Class: TaskMapper::Provider::Bugherd::Project

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

Overview

Project class for taskmapper-bugherd

Constant Summary collapse

API =

The class to access the api’s projects

BugherdAPI::Project

Instance Method Summary collapse

Constructor Details

#initialize(*object) ⇒ Project

declare needed overloaded methods here



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 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 = {:id => object.id,
                :name => object.name,
                :created_at => object.created_at,
                :updated_at => object.updated_at}
        
    else
      hash = object
    end
    super hash
  end
end

Instance Method Details

#copy(project) ⇒ Object

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



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

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