Class: RGFA::CIGAR::Operation
Overview
An operation in a CIGAR string
Constant Summary collapse
- CODE =
CIGAR operation code
[:M, :I, :D, :N, :S, :H, :P, :X, :"="]
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#len ⇒ Object
Returns the value of attribute len.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Compare two operations.
-
#initialize(len, code) ⇒ Operation
constructor
A new instance of Operation.
-
#to_cigar_operation ⇒ RGFA::CIGAR::Operation
Self.
-
#to_s ⇒ String
The string representation of the operation.
-
#validate! ⇒ void
Validate the operation.
Constructor Details
#initialize(len, code) ⇒ Operation
Returns a new instance of Operation.
102 103 104 105 |
# File 'lib/rgfa/cigar.rb', line 102 def initialize(len, code) @len = len @code = code end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
95 96 97 |
# File 'lib/rgfa/cigar.rb', line 95 def code @code end |
#len ⇒ Object
Returns the value of attribute len.
94 95 96 |
# File 'lib/rgfa/cigar.rb', line 94 def len @len end |
Instance Method Details
#==(other) ⇒ Boolean
Compare two operations
115 116 117 |
# File 'lib/rgfa/cigar.rb', line 115 def ==(other) other.len == len and other.code == code end |
#to_cigar_operation ⇒ RGFA::CIGAR::Operation
Returns self.
131 132 133 |
# File 'lib/rgfa/cigar.rb', line 131 def to_cigar_operation self end |
#to_s ⇒ String
The string representation of the operation
109 110 111 |
# File 'lib/rgfa/cigar.rb', line 109 def to_s "#{len}#{code}" end |