Class: Reek::CLI::Command::BaseCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/reek/cli/command/base_command.rb

Overview

Base class for all commands

Direct Known Subclasses

ReportCommand, TodoListCommand

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options:, sources:, configuration:) ⇒ BaseCommand

Returns a new instance of BaseCommand.



10
11
12
13
14
# File 'lib/reek/cli/command/base_command.rb', line 10

def initialize(options:, sources:, configuration:)
  @options = options
  @sources = sources
  @configuration = configuration
end

Instance Attribute Details

#configurationObject (readonly, private)

Returns the value of attribute configuration.



18
19
20
# File 'lib/reek/cli/command/base_command.rb', line 18

def configuration
  @configuration
end

#optionsObject (readonly, private)

Returns the value of attribute options.



18
19
20
# File 'lib/reek/cli/command/base_command.rb', line 18

def options
  @options
end

#sourcesObject (readonly, private)

Returns the value of attribute sources.



18
19
20
# File 'lib/reek/cli/command/base_command.rb', line 18

def sources
  @sources
end

Instance Method Details

#smell_namesObject (private)



20
21
22
# File 'lib/reek/cli/command/base_command.rb', line 20

def smell_names
  @smell_names ||= options.smells_to_detect
end