in progress
[jalview.git] / forester / ruby / evoruby / lib / evo / taxonomy / sp_taxonomy.rb
1 #
2 # = lib/evo/taxonomy/sp_taxonomy.rb - SpTaxonomy class
3 #
4 # Copyright::  Copyright (C) 2006-2007 Christian M. Zmasek
5 # License::    GNU Lesser General Public License (LGPL)
6 #
7 # $Id: sp_taxonomy.rb,v 1.1 2008/12/30 05:28:00 cmzmasek Exp $
8
9
10
11 module Evoruby
12
13     class SpTaxonomy
14
15         attr_accessor :code, :id, :scientific_name, :common_name
16         
17         def initialize( code, id, scientific_name, common_name = nil )
18             @code = String.new( code.strip() )
19             @id = String.new( id.strip() )
20             @scientific_name = String.new( scientific_name.strip() )
21             if ( common_name == nil )
22                 @common_name = String.new()
23             else
24                 @common_name = String.new( common_name.strip() )
25             end
26         end
27
28         def copy
29             return Taxonomy.new( code, id, scientific_name, common_name  )
30         end
31
32         def to_str()
33             code + " " + id + ": N=" + scientific_name
34         end
35
36     end # class SpTaxonomy
37
38 end # module Evoruby