lib/doggy/cli/unmute.rb in doggy-0.2.2 vs lib/doggy/cli/unmute.rb in doggy-2.0.0
- old
+ new
@@ -1,19 +1,15 @@
module Doggy
class CLI::Unmute
- attr_reader :options, :ids
-
def initialize(options, ids)
@options = options
- @ids = ids
+ @ids = ids
end
def run
- begin
- Doggy::Monitor.unmute(ids)
- rescue DoggyError
- puts "Unmute failed."
- exit 1
- end
+ monitors = @ids.map { |id| Doggy::Models::Monitor.find(id) }
+ monitors.each(&:unmute)
end
end
end
+
+