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