Class: Kamelopard::Alias

Inherits:
Object
  • Object
show all
Defined in:
lib/kamelopard/classes.rb

Overview

Sub-object in the KML ResourceMap class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(targetHref = nil, sourceHref = nil) ⇒ Alias

Returns a new instance of Alias.



2370
2371
2372
2373
# File 'lib/kamelopard/classes.rb', line 2370

def initialize(targetHref = nil, sourceHref = nil)
    @targetHref = targetHref
    @sourceHref = sourceHref
end

Instance Attribute Details

#sourceHrefObject

Returns the value of attribute sourceHref.



2369
2370
2371
# File 'lib/kamelopard/classes.rb', line 2369

def sourceHref
  @sourceHref
end

#targetHrefObject

Returns the value of attribute targetHref.



2369
2370
2371
# File 'lib/kamelopard/classes.rb', line 2369

def targetHref
  @targetHref
end

Instance Method Details

#to_kml(elem = nil) ⇒ Object



2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
# File 'lib/kamelopard/classes.rb', line 2375

def to_kml(elem = nil)
    x = XML::Node.new 'Alias'
    {
        :targetHref => @targetHref,
        :sourceHref => @sourceHref,
    }.each do |k, v|
        d = XML::Node.new k.to_s
        d << v.to_s
        x << d
    end
    elem << x unless elem.nil?
    x
end