Class: Retab::ReconciliationAlignment

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/retab/consensus/reconciliation_alignment.rb

Constant Summary collapse

HASH_ATTRS =
{
  aligned_inputs: :aligned_inputs,
  path_alignments: :path_alignments,
  reference_index: :reference_index
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ ReconciliationAlignment

Returns a new instance of ReconciliationAlignment.



20
21
22
23
24
25
26
27
28
# File 'lib/retab/consensus/reconciliation_alignment.rb', line 20

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @aligned_inputs = (hash[:aligned_inputs] || []).map { |item| item || {} }
  @path_alignments = (hash[:path_alignments] || []).map { |item|
    item ? Retab::ReconciliationPathAlignment.new(item) : nil
  }
  @reference_index = hash[:reference_index]
end

Instance Attribute Details

#aligned_inputsObject

Returns the value of attribute aligned_inputs.



14
15
16
# File 'lib/retab/consensus/reconciliation_alignment.rb', line 14

def aligned_inputs
  @aligned_inputs
end

#path_alignmentsObject

Returns the value of attribute path_alignments.



14
15
16
# File 'lib/retab/consensus/reconciliation_alignment.rb', line 14

def path_alignments
  @path_alignments
end

#reference_indexObject

Returns the value of attribute reference_index.



14
15
16
# File 'lib/retab/consensus/reconciliation_alignment.rb', line 14

def reference_index
  @reference_index
end