Sha256: 51a1cebc5ded46fcdbfd9590c37402a7b1c6f37d1d39bc891514bb5de65cf90a

Contents?: true

Size: 448 Bytes

Versions: 6

Compression:

Stored size: 448 Bytes

Contents

# encoding: utf-8

module Doggy
  class CLI::Unmute
    def initialize(options, ids)
      @options = options
      @ids = ids
    end

    def run
      monitors = @ids.map { |id| Doggy::Models::Monitor.find(id) }
      body = {}
      body[:all_scopes] = true if @options['all_scopes']
      body[:scope] = @options['scope'] if @options['scope']
      monitors.each { |monitor| monitor.toggle_mute!('unmute', JSON.dump(body)) }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
doggy-2.0.42 lib/doggy/cli/unmute.rb
doggy-2.0.41 lib/doggy/cli/unmute.rb
doggy-2.0.40 lib/doggy/cli/unmute.rb
doggy-2.0.39 lib/doggy/cli/unmute.rb
doggy-2.0.38 lib/doggy/cli/unmute.rb
doggy-2.0.37 lib/doggy/cli/unmute.rb