Class: Bio::BioAlignment::Element
- Inherits:
-
Object
- Object
- Bio::BioAlignment::Element
- Includes:
- State
- Defined in:
- lib/bio-alignment/elements.rb
Overview
Simple element that can be queried
Constant Summary collapse
- GAP =
'-'
- UNDEFINED =
'X'
Instance Attribute Summary
Attributes included from State
Instance Method Summary collapse
- #==(other) ⇒ Object
- #clone ⇒ Object
- #gap? ⇒ Boolean
-
#initialize(c) ⇒ Element
constructor
A new instance of Element.
- #to_s ⇒ Object
- #undefined? ⇒ Boolean
Constructor Details
#initialize(c) ⇒ Element
Returns a new instance of Element.
11 12 13 14 |
# File 'lib/bio-alignment/elements.rb', line 11 def initialize c @c = c @c.freeze end |
Instance Method Details
#==(other) ⇒ Object
24 25 26 |
# File 'lib/bio-alignment/elements.rb', line 24 def == other to_s == other.to_s end |
#clone ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/bio-alignment/elements.rb', line 27 def clone e = self.dup if e.state != nil e.state = e.state.clone end e end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/bio-alignment/elements.rb', line 21 def to_s @c end |
#undefined? ⇒ Boolean
18 19 20 |
# File 'lib/bio-alignment/elements.rb', line 18 def undefined? @c == 'X' end |