Class: RuboCop::CLI::Environment

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/cli/environment.rb

Overview

Execution environment for a CLI command.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options, config_store, paths) ⇒ Environment

Returns a new instance of Environment.


9
10
11
12
13
# File 'lib/rubocop/cli/environment.rb', line 9

def initialize(options, config_store, paths)
  @options = options
  @config_store = config_store
  @paths = paths
end

Instance Attribute Details

#config_storeObject (readonly)

Returns the value of attribute config_store


7
8
9
# File 'lib/rubocop/cli/environment.rb', line 7

def config_store
  @config_store
end

#optionsObject (readonly)

Returns the value of attribute options


7
8
9
# File 'lib/rubocop/cli/environment.rb', line 7

def options
  @options
end

#pathsObject (readonly)

Returns the value of attribute paths


7
8
9
# File 'lib/rubocop/cli/environment.rb', line 7

def paths
  @paths
end

Instance Method Details

#run(name) ⇒ Object

Run a command in this environment.


16
17
18
# File 'lib/rubocop/cli/environment.rb', line 16

def run(name)
  Command.run(self, name)
end