Class: Jira::Command::Comment::Add

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ticket, options) ⇒ Add

Returns a new instance of Add.



18
19
20
21
# File 'lib/jira/commands/comment/add.rb', line 18

def initialize(ticket, options)
  self.ticket = ticket
  self.options = options
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



16
17
18
# File 'lib/jira/commands/comment/add.rb', line 16

def options
  @options
end

#ticketObject

Returns the value of attribute ticket.



16
17
18
# File 'lib/jira/commands/comment/add.rb', line 16

def ticket
  @ticket
end

Instance Method Details

#runObject



23
24
25
26
27
28
29
# File 'lib/jira/commands/comment/add.rb', line 23

def run
  return if text.empty?
  api.post "issue/#{ticket}/comment",
    params:  params,
    success: on_success,
    failure: on_failure
end