Class: Rubydex::RuleConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/rubydex/config.rb,
ext/rubydex/config.c

Overview

The settings of a single linter rule, read from a [linter.rules.RuleName] table.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, enabled, exclude_patterns = [], severity = nil) ⇒ RuleConfig

: (String, bool, ?Array, ?singleton(Severity::Base)?) -> void



47
48
49
50
51
52
# File 'lib/rubydex/config.rb', line 47

def initialize(name, enabled, exclude_patterns = [], severity = nil)
  @name = name
  @enabled = enabled
  @exclude_patterns = exclude_patterns
  @severity = severity
end

Instance Attribute Details

#exclude_patternsObject (readonly)

: Array



41
42
43
# File 'lib/rubydex/config.rb', line 41

def exclude_patterns
  @exclude_patterns
end

#nameObject (readonly)

: String



38
39
40
# File 'lib/rubydex/config.rb', line 38

def name
  @name
end

#severityObject (readonly)

: singleton(Severity::Base)?



44
45
46
# File 'lib/rubydex/config.rb', line 44

def severity
  @severity
end

Instance Method Details

#enabled?Boolean

: () -> bool

Returns:

  • (Boolean)


55
56
57
# File 'lib/rubydex/config.rb', line 55

def enabled?
  @enabled
end