Class: Retab::ReconciliationResult
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::ReconciliationResult
- Defined in:
- lib/retab/consensus/reconciliation_result.rb
Constant Summary collapse
- HASH_ATTRS =
{ alignment: :alignment, consensus: :consensus, fields: :fields, likelihoods: :likelihoods }.freeze
Instance Attribute Summary collapse
-
#alignment ⇒ Object
Returns the value of attribute alignment.
-
#consensus ⇒ Object
Returns the value of attribute consensus.
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#likelihoods ⇒ Object
Returns the value of attribute likelihoods.
Instance Method Summary collapse
-
#initialize(json) ⇒ ReconciliationResult
constructor
A new instance of ReconciliationResult.
Constructor Details
#initialize(json) ⇒ ReconciliationResult
Returns a new instance of ReconciliationResult.
22 23 24 25 26 27 28 29 |
# File 'lib/retab/consensus/reconciliation_result.rb', line 22 def initialize(json) super() hash = self.class.normalize(json) @alignment = hash[:alignment] ? Retab::ReconciliationAlignment.new(hash[:alignment]) : nil @consensus = hash[:consensus] || {} @fields = (hash[:fields] || []).map { |item| item ? Retab::ReconciliationField.new(item) : nil } @likelihoods = hash[:likelihoods] || {} end |
Instance Attribute Details
#alignment ⇒ Object
Returns the value of attribute alignment.
15 16 17 |
# File 'lib/retab/consensus/reconciliation_result.rb', line 15 def alignment @alignment end |
#consensus ⇒ Object
Returns the value of attribute consensus.
15 16 17 |
# File 'lib/retab/consensus/reconciliation_result.rb', line 15 def consensus @consensus end |
#fields ⇒ Object
Returns the value of attribute fields.
15 16 17 |
# File 'lib/retab/consensus/reconciliation_result.rb', line 15 def fields @fields end |
#likelihoods ⇒ Object
Returns the value of attribute likelihoods.
15 16 17 |
# File 'lib/retab/consensus/reconciliation_result.rb', line 15 def likelihoods @likelihoods end |