Class: Jira::Command::Votes
Instance Attribute Summary collapse
-
#ticket ⇒ Object
Returns the value of attribute ticket.
Instance Method Summary collapse
-
#initialize(ticket) ⇒ Votes
constructor
A new instance of Votes.
- #run ⇒ Object
Constructor Details
#initialize(ticket) ⇒ Votes
Returns a new instance of Votes.
57 58 59 |
# File 'lib/jira/commands/vote.rb', line 57 def initialize(ticket) self.ticket = ticket end |
Instance Attribute Details
#ticket ⇒ Object
Returns the value of attribute ticket.
55 56 57 |
# File 'lib/jira/commands/vote.rb', line 55 def ticket @ticket end |
Instance Method Details
#run ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/jira/commands/vote.rb', line 61 def run return if ticket.empty? return if .empty? voters = ['voters'] if !voters.nil? and voters.count > 0 voters.each do |voter| displayName = voter['displayName'] printf "[%2d]", voters.index(voter) puts " #{Jira::Format.user(displayName)}" end else puts "There are no votes on ticket #{ticket}." end end |