Class: Bio::BioAlignment::Element

Inherits:
Object
  • Object
show all
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

#state

Instance Method Summary collapse

Constructor Details

#initialize(c) ⇒ Element

Returns a new instance of Element.



11
12
13
# File 'lib/bio-alignment/elements.rb', line 11

def initialize c
  @c = c
end

Instance Method Details

#==(other) ⇒ Object



23
24
25
# File 'lib/bio-alignment/elements.rb', line 23

def == other
  to_s == other.to_s
end

#gap?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/bio-alignment/elements.rb', line 14

def gap?
  @c == GAP
end

#to_sObject



20
21
22
# File 'lib/bio-alignment/elements.rb', line 20

def to_s
  @c
end

#undefined?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/bio-alignment/elements.rb', line 17

def undefined?
  @c == 'X'
end