Class: Trac::Ticket
- Inherits:
-
Object
- Object
- Trac::Ticket
- Defined in:
- lib/trac4r/ticket.rb
Overview
This class represents a ticket as it is retrieved from the database
Instance Attribute Summary collapse
-
#cc ⇒ Object
Integer.
-
#created_at ⇒ Object
Integer.
-
#description ⇒ Object
Integer.
-
#id ⇒ Object
Integer.
-
#keywords ⇒ Object
Integer.
-
#milestone ⇒ Object
Integer.
-
#owner ⇒ Object
Integer.
-
#priority ⇒ Object
Integer.
-
#reporter ⇒ Object
Integer.
-
#severity ⇒ Object
Integer.
-
#status ⇒ Object
Integer.
-
#summary ⇒ Object
Integer.
-
#type ⇒ Object
Integer.
-
#updated_at ⇒ Object
Integer.
-
#version ⇒ Object
Integer.
Class Method Summary collapse
-
.load(params) ⇒ Object
loads a ticket from the XMLRPC response.
Instance Method Summary collapse
-
#check ⇒ Object
checks if all attributes are set.
-
#initialize(id = 0) ⇒ Ticket
constructor
returns a new ticket.
Constructor Details
#initialize(id = 0) ⇒ Ticket
returns a new ticket
20 21 22 23 |
# File 'lib/trac4r/ticket.rb', line 20 def initialize id=0 @id = id @severity=@milestone=@status=@type=@priority=@version=@reporter=@owner= @cc= @summary=@description=@keywords="" end |
Instance Attribute Details
#cc ⇒ Object
Integer
4 5 6 |
# File 'lib/trac4r/ticket.rb', line 4 def cc @cc end |
#created_at ⇒ Object
Integer
4 5 6 |
# File 'lib/trac4r/ticket.rb', line 4 def created_at @created_at end |
#description ⇒ Object
Integer
4 5 6 |
# File 'lib/trac4r/ticket.rb', line 4 def description @description end |
#id ⇒ Object
Integer
4 5 6 |
# File 'lib/trac4r/ticket.rb', line 4 def id @id end |
#keywords ⇒ Object
Integer
4 5 6 |
# File 'lib/trac4r/ticket.rb', line 4 def keywords @keywords end |
#milestone ⇒ Object
Integer
4 5 6 |
# File 'lib/trac4r/ticket.rb', line 4 def milestone @milestone end |
#owner ⇒ Object
Integer
4 5 6 |
# File 'lib/trac4r/ticket.rb', line 4 def owner @owner end |
#priority ⇒ Object
Integer
4 5 6 |
# File 'lib/trac4r/ticket.rb', line 4 def priority @priority end |
#reporter ⇒ Object
Integer
4 5 6 |
# File 'lib/trac4r/ticket.rb', line 4 def reporter @reporter end |
#severity ⇒ Object
Integer
4 5 6 |
# File 'lib/trac4r/ticket.rb', line 4 def severity @severity end |
#status ⇒ Object
Integer
4 5 6 |
# File 'lib/trac4r/ticket.rb', line 4 def status @status end |
#summary ⇒ Object
Integer
4 5 6 |
# File 'lib/trac4r/ticket.rb', line 4 def summary @summary end |
#type ⇒ Object
Integer
4 5 6 |
# File 'lib/trac4r/ticket.rb', line 4 def type @type end |
#updated_at ⇒ Object
Integer
4 5 6 |
# File 'lib/trac4r/ticket.rb', line 4 def updated_at @updated_at end |
#version ⇒ Object
Integer
4 5 6 |
# File 'lib/trac4r/ticket.rb', line 4 def version @version end |
Class Method Details
.load(params) ⇒ Object
loads a ticket from the XMLRPC response
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/trac4r/ticket.rb', line 34 def self.load params ticket = self.new params[0] ticket.created_at = params[1] ticket.updated_at = params[2] attributes = params[3] attributes.each do |key,value| ticket.instance_variable_set("@#{key}".to_sym,value) end return ticket end |
Instance Method Details
#check ⇒ Object
checks if all attributes are set
26 27 28 29 30 31 |
# File 'lib/trac4r/ticket.rb', line 26 def check instance_variables.each do |v| return false if instance_variable_get(v.to_sym).nil? end return true end |