Class: Jira::Command::Delete
Instance Attribute Summary collapse
-
#force ⇒ Object
Returns the value of attribute force.
-
#ticket ⇒ Object
Returns the value of attribute ticket.
Instance Method Summary collapse
-
#initialize(ticket, force) ⇒ Delete
constructor
A new instance of Delete.
- #run ⇒ Object
Constructor Details
#initialize(ticket, force) ⇒ Delete
Returns a new instance of Delete.
17 18 19 20 |
# File 'lib/jira/commands/delete.rb', line 17 def initialize(ticket, force) self.ticket = ticket self.force = force end |
Instance Attribute Details
#force ⇒ Object
Returns the value of attribute force.
15 16 17 |
# File 'lib/jira/commands/delete.rb', line 15 def force @force end |
#ticket ⇒ Object
Returns the value of attribute ticket.
15 16 17 |
# File 'lib/jira/commands/delete.rb', line 15 def ticket @ticket end |
Instance Method Details
#run ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/jira/commands/delete.rb', line 22 def run return if ticket.empty? return if .empty? return if ['fields'].nil? return if subtasks_failure? api.delete "issue/#{ticket}?deleteSubtasks=#{force}", success: ->{ puts "Ticket #{ticket} has been deleted." }, failure: ->{ puts "No change made to ticket #{ticket}." } end |