Class: SvgConform::QualityMetrics::Configuration::SeverityLevel
- Inherits:
-
Object
- Object
- SvgConform::QualityMetrics::Configuration::SeverityLevel
- Defined in:
- lib/svg_conform/quality_metrics/configuration.rb
Overview
=========================================================================
Immutable Nested Configuration Objects
Instance Attribute Summary collapse
-
#default_weight ⇒ Object
readonly
Returns the value of attribute default_weight.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#max_penalty ⇒ Object
readonly
Returns the value of attribute max_penalty.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#violation_types ⇒ Object
readonly
Returns the value of attribute violation_types.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
-
#initialize(name, config) ⇒ SeverityLevel
constructor
A new instance of SeverityLevel.
Constructor Details
#initialize(name, config) ⇒ SeverityLevel
Returns a new instance of SeverityLevel.
248 249 250 251 252 253 254 255 |
# File 'lib/svg_conform/quality_metrics/configuration.rb', line 248 def initialize(name, config) @name = name @description = config["description"] @violation_types = config["violation_types"].to_a.map(&:to_sym).freeze @default_weight = config["default_weight"].to_i @max_penalty = config["max_penalty"].to_i freeze end |
Instance Attribute Details
#default_weight ⇒ Object (readonly)
Returns the value of attribute default_weight.
246 247 248 |
# File 'lib/svg_conform/quality_metrics/configuration.rb', line 246 def default_weight @default_weight end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
246 247 248 |
# File 'lib/svg_conform/quality_metrics/configuration.rb', line 246 def description @description end |
#max_penalty ⇒ Object (readonly)
Returns the value of attribute max_penalty.
246 247 248 |
# File 'lib/svg_conform/quality_metrics/configuration.rb', line 246 def max_penalty @max_penalty end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
246 247 248 |
# File 'lib/svg_conform/quality_metrics/configuration.rb', line 246 def name @name end |
#violation_types ⇒ Object (readonly)
Returns the value of attribute violation_types.
246 247 248 |
# File 'lib/svg_conform/quality_metrics/configuration.rb', line 246 def violation_types @violation_types end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
257 258 259 260 261 262 |
# File 'lib/svg_conform/quality_metrics/configuration.rb', line 257 def ==(other) other.is_a?(SeverityLevel) && name == other.name && default_weight == other.default_weight && max_penalty == other.max_penalty end |