Class: Bio::PhyloXML::Uri
- Inherits:
-
Object
- Object
- Bio::PhyloXML::Uri
- Defined in:
- lib/bio/phyloxml/elements.rb
Overview
A uniform resource identifier. In general, this is expected to be an URL (for example, to link to an image on a website, in which case the ‘type’ attribute might be ‘image’ and ‘desc’ might be ‘image of a California sea hare’)
Instance Attribute Summary collapse
-
#desc ⇒ Object
String.
-
#type ⇒ Object
String.
-
#uri ⇒ Object
String.
Instance Method Summary collapse
-
#to_xml ⇒ Object
Converts elements to xml representation.
Instance Attribute Details
#desc ⇒ Object
String. Description of the uri. For example, image of a California sea hare’
663 664 665 |
# File 'lib/bio/phyloxml/elements.rb', line 663 def desc @desc end |
#type ⇒ Object
String. For example, image.
665 666 667 |
# File 'lib/bio/phyloxml/elements.rb', line 665 def type @type end |
#uri ⇒ Object
String. URL of the resource.
667 668 669 |
# File 'lib/bio/phyloxml/elements.rb', line 667 def uri @uri end |
Instance Method Details
#to_xml ⇒ Object
Converts elements to xml representation. Called by PhyloXML::Writer class.
670 671 672 673 674 675 676 677 678 |
# File 'lib/bio/phyloxml/elements.rb', line 670 def to_xml if @uri != nil xml_node = LibXML::XML::Node.new('uri', @uri) Writer.generate_xml(xml_node, self, [ [:attr, 'desc'], [:attr, 'type']]) return xml_node end end |