Sha256: a5a263490c8d96f35a8a26f99eb0bcac880a1404bd67ec96439201f2f0cce0bb

Contents?: true

Size: 580 Bytes

Versions: 4

Compression:

Stored size: 580 Bytes

Contents

module Doggy
  class CLI::Create
    attr_reader :options, :kind, :name

    def initialize(options, kind, name)
      @options = options
      @kind = kind
      @name = name
    end

    def run
      begin
        case kind
        when 'dash', 'dashboard'     then Doggy::Dash.create(name)
        when 'alert', 'monitor'      then Doggy::Monitor.create(name)
        when 'screen', 'screenboard' then Doggy::Screen.create(name)
        else puts 'Unknown item type'
        end
      rescue DoggyError
        puts "Create failed."
        exit 1
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
doggy-0.1.3 lib/doggy/cli/create.rb
doggy-0.1.2 lib/doggy/cli/create.rb
doggy-0.1.1 lib/doggy/cli/create.rb
doggy-0.1.0 lib/doggy/cli/create.rb