Class: Quby::Answers::Entities::Subscore

Inherits:
Object
  • Object
show all
Defined in:
lib/quby/answers/entities/subscore.rb

Overview

Subscore instances describe the subscore keys of answer#scores using score schema information.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(subschema:, score_hash:) ⇒ Subscore

Returns a new instance of Subscore.



17
18
19
20
# File 'lib/quby/answers/entities/subscore.rb', line 17

def initialize(subschema:, score_hash:)
  self.subschema = subschema
  @score_hash = score_hash
end

Instance Attribute Details

#subschemaObject

Returns the value of attribute subschema.



7
8
9
# File 'lib/quby/answers/entities/subscore.rb', line 7

def subschema
  @subschema
end

Instance Method Details

#valueObject



22
23
24
# File 'lib/quby/answers/entities/subscore.rb', line 22

def value
  @score_hash[key]
end