123456789_123456789_123456789_123456789_123456789_

Class: RuboCop::CLI::Command::Base Private

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Inherits: Object
Defined in: lib/rubocop/cli/command/base.rb

Overview

A subcommand in the CLI.

Class Attribute Summary

Class Method Summary

Instance Attribute Summary

  • #env readonly Internal use only

Constructor Details

.new(env) ⇒ Base

[ GitHub ]

  
# File 'lib/rubocop/cli/command/base.rb', line 26

def initialize(env)
  @env = env
  @options = env.options
  @config_store = env.config_store
  @paths = env.paths
end

Class Attribute Details

.command_name (rw)

[ GitHub ]

  
# File 'lib/rubocop/cli/command/base.rb', line 14

attr_accessor :command_name

Class Method Details

.by_command_name(name)

[ GitHub ]

  
# File 'lib/rubocop/cli/command/base.rb', line 21

def by_command_name(name)
  @subclasses.detect { |s| s.command_name == name }
end

.inherited(subclass)

[ GitHub ]

  
# File 'lib/rubocop/cli/command/base.rb', line 16

def inherited(subclass)
  super
  @subclasses << subclass
end

Instance Attribute Details

#env (readonly)

[ GitHub ]

  
# File 'lib/rubocop/cli/command/base.rb', line 9

attr_reader :env