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.



19
20
21
22
# File 'lib/quby/answers/entities/subscore.rb', line 19

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



24
25
26
# File 'lib/quby/answers/entities/subscore.rb', line 24

def value
  @score_hash[key]
end