Class: Jira::Command::Tickets
Instance Attribute Summary collapse
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(username) ⇒ Tickets
constructor
A new instance of Tickets.
- #run ⇒ Object
Constructor Details
#initialize(username) ⇒ Tickets
Returns a new instance of Tickets.
17 18 19 |
# File 'lib/jira/commands/tickets.rb', line 17 def initialize(username) self.username = username end |
Instance Attribute Details
#username ⇒ Object
Returns the value of attribute username.
15 16 17 |
# File 'lib/jira/commands/tickets.rb', line 15 def username @username end |
Instance Method Details
#run ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/jira/commands/tickets.rb', line 21 def run return if username.empty? return if .empty? issues = ['issues'] if !issues.nil? and issues.count > 0 issues.each do |issue| ticket = issue['key'] printf "[%2d]", issues.index(issue) puts " #{Jira::Format.ticket(ticket)}" end else puts "There are no tickets for username #{username}." end end |