Sha256: 2c96c38d0a8aec6d309085cc8c884538a7fc2913b0dbb2ed2bd37884f743d5c8

Contents?: true

Size: 499 Bytes

Versions: 74

Compression:

Stored size: 499 Bytes

Contents

module Clamp
  module Subcommand

    class Definition < Struct.new(:name, :description, :subcommand_class)

      def initialize(names, description, subcommand_class)
        @names = Array(names)
        @description = description
        @subcommand_class = subcommand_class
      end

      attr_reader :names, :description, :subcommand_class

      def is_called?(name)
        names.member?(name)
      end

      def help
        [names.join(", "), description]
      end

    end

  end
end

Version data entries

74 entries across 70 versions & 18 rubygems

Version Path
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/subcommand/definition.rb