Class: SvgConform::QualityMetrics::Configuration::QualityLevel

Inherits:
Object
  • Object
show all
Defined in:
lib/svg_conform/quality_metrics/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, config) ⇒ QualityLevel

Returns a new instance of QualityLevel.



269
270
271
272
273
274
275
# File 'lib/svg_conform/quality_metrics/configuration.rb', line 269

def initialize(name, config)
  @name = name
  @min_score = config["min_score"].to_i
  @max_score = config["max_score"]&.to_i
  @description = config["description"]
  freeze
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



267
268
269
# File 'lib/svg_conform/quality_metrics/configuration.rb', line 267

def description
  @description
end

#max_scoreObject (readonly)

Returns the value of attribute max_score.



267
268
269
# File 'lib/svg_conform/quality_metrics/configuration.rb', line 267

def max_score
  @max_score
end

#min_scoreObject (readonly)

Returns the value of attribute min_score.



267
268
269
# File 'lib/svg_conform/quality_metrics/configuration.rb', line 267

def min_score
  @min_score
end

#nameObject (readonly)

Returns the value of attribute name.



267
268
269
# File 'lib/svg_conform/quality_metrics/configuration.rb', line 267

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



277
278
279
280
281
# File 'lib/svg_conform/quality_metrics/configuration.rb', line 277

def ==(other)
  other.is_a?(QualityLevel) &&
    name == other.name &&
    min_score == other.min_score
end