Class: Jira::Command::Vote
Instance Attribute Summary collapse
-
#ticket ⇒ Object
Returns the value of attribute ticket.
Instance Method Summary collapse
-
#initialize(ticket) ⇒ Vote
constructor
A new instance of Vote.
- #run ⇒ Object
Constructor Details
#initialize(ticket) ⇒ Vote
Returns a new instance of Vote.
28 29 30 |
# File 'lib/jira/commands/vote.rb', line 28 def initialize(ticket) self.ticket = ticket end |
Instance Attribute Details
#ticket ⇒ Object
Returns the value of attribute ticket.
26 27 28 |
# File 'lib/jira/commands/vote.rb', line 26 def ticket @ticket end |
Instance Method Details
#run ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/jira/commands/vote.rb', line 32 def run return if ticket.empty? api.post "issue/#{ticket}/votes", params: Jira::Core.username, success: on_success, failure: on_failure end |