Class: SkillBench::Dimension

Inherits:
Object
  • Object
show all
Defined in:
lib/skill_bench/dimension.rb

Overview

Value object representing a scoring dimension for evaluation.

Dimensions are used by the judge to score agent output across different aspects such as correctness, code quality, and skill adherence.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, description:, max_score:) ⇒ Dimension

Returns a new instance of Dimension.

Parameters:

  • name (String)

    The machine-friendly identifier for the dimension.

  • description (String)

    Human-readable explanation of what the dimension measures.

  • max_score (Integer, nil)

    Maximum score this dimension can contribute. Nil in defaults.



14
15
16
17
18
# File 'lib/skill_bench/dimension.rb', line 14

def initialize(name:, description:, max_score:)
  @name = name
  @description = description
  @max_score = max_score
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



9
10
11
# File 'lib/skill_bench/dimension.rb', line 9

def description
  @description
end

#max_scoreObject (readonly)

Returns the value of attribute max_score.



9
10
11
# File 'lib/skill_bench/dimension.rb', line 9

def max_score
  @max_score
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/skill_bench/dimension.rb', line 9

def name
  @name
end

Instance Method Details

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

Compares two Dimension instances for equality.

Parameters:

  • other (Object)

    The object to compare against.

Returns:

  • (Boolean)

    true when all attributes match.



24
25
26
27
28
29
# File 'lib/skill_bench/dimension.rb', line 24

def ==(other)
  other.is_a?(Dimension) &&
    name == other.name &&
    description == other.description &&
    max_score == other.max_score
end

#hashInteger

Computes a hash code based on attributes.

Returns:

  • (Integer)

    The hash code.



35
36
37
# File 'lib/skill_bench/dimension.rb', line 35

def hash
  [name, description, max_score].hash
end