Sha256: c61d25d978ca76e0b1440a4bd1a7d95b59037eb78af35047d7b61e01d1bf0fd1

Contents?: true

Size: 478 Bytes

Versions: 2

Compression:

Stored size: 478 Bytes

Contents

# encoding: utf-8
# frozen_string_literal: true

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

2 entries across 2 versions & 1 rubygems

Version Path
doggy-2.1.1 lib/doggy/cli/unmute.rb
doggy-2.1.0 lib/doggy/cli/unmute.rb