Class: Kamelopard::Alias
- Inherits:
-
Object
- Object
- Kamelopard::Alias
- Defined in:
- lib/kamelopard/classes.rb
Overview
Sub-object in the KML ResourceMap class
Instance Attribute Summary collapse
-
#sourceHref ⇒ Object
Returns the value of attribute sourceHref.
-
#targetHref ⇒ Object
Returns the value of attribute targetHref.
Instance Method Summary collapse
-
#initialize(targetHref = nil, sourceHref = nil) ⇒ Alias
constructor
A new instance of Alias.
- #to_kml(elem = nil) ⇒ Object
Constructor Details
#initialize(targetHref = nil, sourceHref = nil) ⇒ Alias
Returns a new instance of Alias.
1749 1750 1751 1752 |
# File 'lib/kamelopard/classes.rb', line 1749 def initialize(targetHref = nil, sourceHref = nil) @targetHref = targetHref @sourceHref = sourceHref end |
Instance Attribute Details
#sourceHref ⇒ Object
Returns the value of attribute sourceHref.
1748 1749 1750 |
# File 'lib/kamelopard/classes.rb', line 1748 def sourceHref @sourceHref end |
#targetHref ⇒ Object
Returns the value of attribute targetHref.
1748 1749 1750 |
# File 'lib/kamelopard/classes.rb', line 1748 def targetHref @targetHref end |
Instance Method Details
#to_kml(elem = nil) ⇒ Object
1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 |
# File 'lib/kamelopard/classes.rb', line 1754 def to_kml(elem = nil) x = REXML::Element.new 'Alias' { :targetHref => @targetHref, :sourceHref => @sourceHref, }.each do |k, v| d = REXML::Element.new k.to_s d.text = v x << d end elem << x unless elem.nil? x end |