Class: Ticket
Overview
This program allows you to use command line to perform your typical assembla.com tasks. USing it you can check for new tickets, change status, reasign them or create new ones
- Author
-
Ignacy Moryc ([email protected])
- License
-
MIT
This is the ticket class responsible for describing the ticket object.
Instance Attribute Summary collapse
-
#assigned_to ⇒ Object
Returns the value of attribute assigned_to.
-
#id ⇒ Object
Returns the value of attribute id.
-
#status ⇒ Object
Returns the value of attribute status.
-
#summary ⇒ Object
Returns the value of attribute summary.
Instance Method Summary collapse
- #details ⇒ Object
-
#initialize(id, summary, status, assigned_to) ⇒ Ticket
constructor
:nodoc:.
-
#to_s ⇒ Object
:nodoc:.
Constructor Details
#initialize(id, summary, status, assigned_to) ⇒ Ticket
:nodoc:
14 15 16 17 18 19 |
# File 'lib/ticket.rb', line 14 def initialize(id, summary, status, assigned_to) #:nodoc: self.id = id.to_i self.summary = summary self.status = status self.assigned_to = assigned_to end |
Instance Attribute Details
#assigned_to ⇒ Object
Returns the value of attribute assigned_to.
12 13 14 |
# File 'lib/ticket.rb', line 12 def assigned_to @assigned_to end |
#id ⇒ Object
Returns the value of attribute id.
12 13 14 |
# File 'lib/ticket.rb', line 12 def id @id end |
#status ⇒ Object
Returns the value of attribute status.
12 13 14 |
# File 'lib/ticket.rb', line 12 def status @status end |
#summary ⇒ Object
Returns the value of attribute summary.
12 13 14 |
# File 'lib/ticket.rb', line 12 def summary @summary end |
Instance Method Details
#details ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/ticket.rb', line 25 def details details = <<DETAILS Id: #{self.id} Status: #{self.status.to_s} AssignedTo: #{self.assigned_to} ----------------------------------------------- Sumary: #{self.summary} ----------------------------------------------- DETAILS end |
#to_s ⇒ Object
:nodoc:
21 22 23 |
# File 'lib/ticket.rb', line 21 def to_s #:nodoc: "#{self.id.to_s.center(5)}|#{self.assigned_to.center(18)}|#{self.status.to_s.center(10)}| #{self.summary} \n" end |