Class: SCSSLint::AutoCorrect::Correctors::VariableName
- Inherits:
-
Base
- Object
- Base
- SCSSLint::AutoCorrect::Correctors::VariableName
show all
- Defined in:
- lib/scss_lint/auto_correct/correctors/variable_name.rb
Instance Attribute Summary
Attributes inherited from Base
#config
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#enabled?, #initialize, priority, short_name
Class Method Details
.description ⇒ Object
11
12
13
|
# File 'lib/scss_lint/auto_correct/correctors/variable_name.rb', line 11
def self.description
"Use dashes instead of underscores in variable names"
end
|
.linter_name ⇒ Object
7
8
9
|
# File 'lib/scss_lint/auto_correct/correctors/variable_name.rb', line 7
def self.linter_name
"NameFormat"
end
|
Instance Method Details
#call(contents) ⇒ Object
3
4
5
|
# File 'lib/scss_lint/auto_correct/correctors/variable_name.rb', line 3
def call(contents)
contents.gsub(/\$[a-z_-]+/) { |m| m.gsub('_', '-') }
end
|