Class: Bio::PhyloXML::DomainArchitecture
- Inherits:
-
Object
- Object
- Bio::PhyloXML::DomainArchitecture
- Defined in:
- lib/bio-phyloxml/phyloxml_elements.rb
Overview
Description
This is used describe the domain architecture of a protein. Attribute ‘length’ is the total length of the protein
Instance Attribute Summary collapse
-
#domains ⇒ Object
readonly
Array of ProteinDomain objects.
-
#length ⇒ Object
Integer.
Instance Method Summary collapse
-
#initialize ⇒ DomainArchitecture
constructor
A new instance of DomainArchitecture.
-
#to_xml ⇒ Object
Converts elements to xml representation.
Constructor Details
#initialize ⇒ DomainArchitecture
Returns a new instance of DomainArchitecture.
850 851 852 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 850 def initialize @domains = [] end |
Instance Attribute Details
#domains ⇒ Object (readonly)
Array of ProteinDomain objects.
843 844 845 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 843 def domains @domains end |
#length ⇒ Object
Integer. Total length of the protein
840 841 842 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 840 def length @length end |
Instance Method Details
#to_xml ⇒ Object
Converts elements to xml representation. Called by PhyloXML::Writer class.
855 856 857 858 859 860 861 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 855 def to_xml xml_node = LibXML::XML::Node.new('domain_architecture') PhyloXML::Writer.generate_xml(xml_node, self,[ [:attr, 'length'], [:objarr, 'domain', 'domains']]) return xml_node end |