Class: Bio::BioAlignment::Row

Inherits:
Object
  • Object
show all
Includes:
State
Defined in:
lib/bio-alignment/rows.rb

Overview

Support the notion of Rows in an alignment. A Row can have state by attaching state objects

Instance Attribute Summary

Attributes included from State

#state

Instance Method Summary collapse

Constructor Details

#initialize(aln, row) ⇒ Row

Returns a new instance of Row.



28
29
30
31
32
# File 'lib/bio-alignment/rows.rb', line 28

def initialize aln, row
  @aln = aln
  @row = row
  freeze
end

Instance Method Details

#count(&block) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/bio-alignment/rows.rb', line 34

def count &block
  counter = 0
  each do | e |
    found = 
      if e.kind_of?(String)
        block.call(Element.new(e))
      else
        block.call(e)
      end
    counter += 1 if found
  end
  counter
end