Class: Jira::Command::Vote

Inherits:
Base
  • Object
show all
Defined in:
lib/jira/commands/vote.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#ticketObject

Returns the value of attribute ticket.



26
27
28
# File 'lib/jira/commands/vote.rb', line 26

def ticket
  @ticket
end

Instance Method Details

#runObject



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