Class: RubocopTodoCorrector::Commands::Ignore

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop_todo_corrector/commands/ignore.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cop_name:, ignore_file_path:) ⇒ Ignore

Returns a new instance of Ignore.



22
23
24
25
26
27
28
# File 'lib/rubocop_todo_corrector/commands/ignore.rb', line 22

def initialize(
  cop_name:,
  ignore_file_path:
)
  @cop_name = cop_name
  @ignore_file_path = ignore_file_path
end

Class Method Details

.call(cop_name:, ignore_file_path:) ⇒ Object

Parameters:

  • cop_name (String)
  • ignore_file_path (String)


11
12
13
14
15
16
17
18
19
# File 'lib/rubocop_todo_corrector/commands/ignore.rb', line 11

def call(
  cop_name:,
  ignore_file_path:
)
  new(
    cop_name:,
    ignore_file_path:
  ).call
end

Instance Method Details

#callObject



30
31
32
# File 'lib/rubocop_todo_corrector/commands/ignore.rb', line 30

def call
  IgnoreFile.new(path: @ignore_file_path).append_cop_name(@cop_name)
end