Class: RubomaticHtml::Cop::Style::NoFormTag

Inherits:
Base
  • Object
show all
Defined in:
lib/rubomatic-html/cop/style/no_form_tag.rb

Instance Attribute Summary

Attributes inherited from Base

#config, #file

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

department

Methods inherited from Base

allowed_config_transform, #initialize

Constructor Details

This class inherits a constructor from RubomaticHtml::Cop::Base

Class Method Details

.abstract_cop?Boolean

Returns:

  • (Boolean)

See Also:

  • super


9
10
11
# File 'lib/rubomatic-html/cop/style/no_form_tag.rb', line 9

def abstract_cop?
  false
end

.nameObject

See Also:

  • super


14
15
16
# File 'lib/rubomatic-html/cop/style/no_form_tag.rb', line 14

def name
  [department, 'NoFormTag'].join('/')
end

Instance Method Details

#run_for_line(line, index) ⇒ Object

See Also:

  • super


20
21
22
23
24
# File 'lib/rubomatic-html/cop/style/no_form_tag.rb', line 20

def run_for_line(line, index)
  return unless line.match?(/form_tag/i)

  puts("#{file}:#{index}: calls `form_tag`. Use `form_with` instead")
end