Class: StrideAlign::AlignmentResult

Inherits:
AlignmentPath show all
Defined in:
lib/stride_align/alignment_path.rb

Constant Summary

Constants inherited from AlignmentPath

StrideAlign::AlignmentPath::ATTRIBUTES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AlignmentPath

#inspect

Constructor Details

#initialize(aligned_query: "", aligned_target: "", **attributes) ⇒ AlignmentResult

Returns a new instance of AlignmentResult.



44
45
46
47
48
# File 'lib/stride_align/alignment_path.rb', line 44

def initialize(aligned_query: "", aligned_target: "", **attributes)
  super(**attributes)
  @aligned_query = aligned_query
  @aligned_target = aligned_target
end

Instance Attribute Details

#aligned_queryObject (readonly)

Returns the value of attribute aligned_query.



42
43
44
# File 'lib/stride_align/alignment_path.rb', line 42

def aligned_query
  @aligned_query
end

#aligned_targetObject (readonly)

Returns the value of attribute aligned_target.



42
43
44
# File 'lib/stride_align/alignment_path.rb', line 42

def aligned_target
  @aligned_target
end

Instance Method Details

#alignedObject



50
51
52
# File 'lib/stride_align/alignment_path.rb', line 50

def aligned
  { query: aligned_query, target: aligned_target }
end

#to_hObject



54
55
56
# File 'lib/stride_align/alignment_path.rb', line 54

def to_h
  super.merge(aligned: aligned)
end

#to_pathObject



58
59
60
61
62
63
# File 'lib/stride_align/alignment_path.rb', line 58

def to_path
  attributes = AlignmentPath::ATTRIBUTES.each_with_object({}) do |name, output|
    output[name] = public_send(name)
  end
  AlignmentPath.new(**attributes)
end