Method: Bio::Nexus#to_s

Defined in:
lib/bio/db/nexus.rb

#to_sObject Also known as: to_str

Returns a String listing how many of each blocks it parsed.


Returns

String



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/bio/db/nexus.rb', line 263

def to_s
  str = String.new
  if get_blocks.length < 1
    str << "empty"
  else 
    str << "number of blocks: " << get_blocks.length.to_s
    if get_characters_blocks.length > 0
      str << " [characters blocks: " << get_characters_blocks.length.to_s << "] "
    end  
    if get_data_blocks.length > 0
      str << " [data blocks: " << get_data_blocks.length.to_s << "] "
    end
    if get_distances_blocks.length > 0
      str << " [distances blocks: " << get_distances_blocks.length.to_s << "] "
    end  
    if get_taxa_blocks.length > 0
      str << " [taxa blocks: " << get_taxa_blocks.length.to_s << "] "
    end    
    if get_trees_blocks.length > 0
      str << " [trees blocks: " << get_trees_blocks.length.to_s << "] "
    end        
  end
  str
end