Class: CsvCop::Cop::Lint::DeplicatedElementInOneColumn
- Defined in:
- lib/csvcop/cop/uniq_column.rb
Constant Summary collapse
- MSG =
'Column is must uniq element.'
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(csv, config) ⇒ DeplicatedElementInOneColumn
constructor
A new instance of DeplicatedElementInOneColumn.
- #run ⇒ Object
Methods inherited from Cop
Constructor Details
#initialize(csv, config) ⇒ DeplicatedElementInOneColumn
Returns a new instance of DeplicatedElementInOneColumn.
7 8 9 10 |
# File 'lib/csvcop/cop/uniq_column.rb', line 7 def initialize(csv, config) @csv = csv @config = config end |
Class Method Details
.config_key ⇒ Object
16 17 18 |
# File 'lib/csvcop/cop/uniq_column.rb', line 16 def self.config_key self.name.split("::").last.to_sym end |
.enable?(config) ⇒ Boolean
12 13 14 |
# File 'lib/csvcop/cop/uniq_column.rb', line 12 def self.enable?(config) config[:AllCops][config_key][:Enable] end |
Instance Method Details
#run ⇒ Object
20 21 22 23 |
# File 'lib/csvcop/cop/uniq_column.rb', line 20 def run return false unless DeplicatedElementInOneColumn.enable?(@config) on_ensure end |