Class: Qti::V1::Models::Numerics::MarginError

Inherits:
ScoringBase
  • Object
show all
Defined in:
lib/qti/v1/models/numerics/margin_error.rb

Instance Method Summary collapse

Methods inherited from ScoringBase

#equal_node, #gt_node, #gte_node, #initialize, #lte_node

Constructor Details

This class inherits a constructor from Qti::V1::Models::Numerics::ScoringBase

Instance Method Details

#scoring_dataObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/qti/v1/models/numerics/margin_error.rb', line 6

def scoring_data
  return unless valid?
  Struct.new(
    :id,
    :type,
    :value,
    :margin,
    :margin_type
  ).new(
    equal_node.attributes['respident']&.value,
    'marginOfError',
    equal_node.content.to_f.to_s,
    margin,
    margin_type
  )
end