Class: Bio::NeXML::Matrix
- Inherits:
-
Object
- Object
- Bio::NeXML::Matrix
- Includes:
- Mapper
- Defined in:
- lib/bio/db/nexml/matrix.rb
Direct Known Subclasses
Constant Summary collapse
Instance Attribute Summary collapse
-
#id ⇒ Object
Because matrix elements don’t have id attributes, we will use object_id in this case.
Instance Method Summary collapse
- #add_row(row) ⇒ Object
-
#initialize(options = {}) ⇒ Matrix
constructor
A new instance of Matrix.
- #to_xml ⇒ Object
Methods included from Mapper
Constructor Details
#initialize(options = {}) ⇒ Matrix
Returns a new instance of Matrix.
547 548 549 550 551 |
# File 'lib/bio/db/nexml/matrix.rb', line 547 def initialize( = {} ) @id = self.object_id properties( ) unless .empty? block.arity < 1 ? instance_eval( &block ) : block.call( self ) if block_given? end |
Instance Attribute Details
#id ⇒ Object
Because matrix elements don’t have id attributes, we will use object_id in this case
545 546 547 |
# File 'lib/bio/db/nexml/matrix.rb', line 545 def id @id end |
Instance Method Details
#add_row(row) ⇒ Object
553 554 555 |
# File 'lib/bio/db/nexml/matrix.rb', line 553 def add_row( row ) # dummy for rdoc end |
#to_xml ⇒ Object
618 619 620 621 622 623 624 |
# File 'lib/bio/db/nexml/matrix.rb', line 618 def to_xml node = @@writer.create_node( "matrix" ) self.each_row do |row| node << row.to_xml end node end |