Class Trac::Ticket
In: lib/ticket.rb
Parent: Object

This class represents a ticket as it is retrieved from the database

Methods

check   load   new  

Attributes

cc  [RW] 
created_at  [RW] 
description  [RW] 
id  [RW] 
keywords  [RW] 
milestone  [RW] 
owner  [RW] 
priority  [RW] 
reporter  [RW] 
severity  [RW] 
status  [RW] 
summary  [RW] 
type  [RW] 
updated_at  [RW] 
version  [RW] 

Public Class methods

loads a ticket from the XMLRPC response

[Source]

    # File lib/ticket.rb, line 34
34:     def self.load params
35:       ticket = self.new params[0]
36:       ticket.created_at = params[1]
37:       ticket.updated_at = params[2]
38:       attributes = params[3]
39:       attributes.each do |key,value|
40:         ticket.instance_variable_set("@#{key}".to_sym,value)
41:       end
42:       return ticket
43:     end

returns a new ticket

[Source]

    # File lib/ticket.rb, line 20
20:     def initialize id=0
21:       @id = id
22:       @severity=@milestone=@status=@type=@priority=@version=@reporter=@owner= @cc= @summary=@description=@keywords=""
23:     end

Public Instance methods

checks if all attributes are set

[Source]

    # File lib/ticket.rb, line 26
26:     def check
27:       instance_variables.each do |v|
28:         return false if instance_variable_get(v.to_sym).nil?
29:       end
30:       return true
31:     end

[Validate]