Class: Jira::Command::Unwatch
Instance Attribute Summary collapse
-
#ticket ⇒ Object
Returns the value of attribute ticket.
Instance Method Summary collapse
-
#initialize(ticket) ⇒ Unwatch
constructor
A new instance of Unwatch.
- #run ⇒ Object
Constructor Details
#initialize(ticket) ⇒ Unwatch
Returns a new instance of Unwatch.
90 91 92 |
# File 'lib/jira/commands/watch.rb', line 90 def initialize(ticket) self.ticket = ticket end |
Instance Attribute Details
#ticket ⇒ Object
Returns the value of attribute ticket.
88 89 90 |
# File 'lib/jira/commands/watch.rb', line 88 def ticket @ticket end |
Instance Method Details
#run ⇒ Object
94 95 96 97 98 99 100 101 |
# File 'lib/jira/commands/watch.rb', line 94 def run return if ticket.empty? username = Jira::Core.username api.delete "issue/#{ticket}/watchers?username=#{username}", success: on_success, failure: on_failure end |