Class: Region

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

Overview

Corresponds to the KML Region object

Instance Attribute Summary collapse

Attributes inherited from KMLObject

#comment, #id

Instance Method Summary collapse

Constructor Details

#initialize(latlonaltbox, lod) ⇒ Region

Returns a new instance of Region.



1549
1550
1551
1552
1553
# File 'lib/kamelopard/classes.rb', line 1549

def initialize(latlonaltbox, lod)
    super()
    @latlonaltbox = latlonaltbox
    @lod = lod
end

Instance Attribute Details

#latlonaltboxObject

Returns the value of attribute latlonaltbox.



1547
1548
1549
# File 'lib/kamelopard/classes.rb', line 1547

def latlonaltbox
  @latlonaltbox
end

#lodObject

Returns the value of attribute lod.



1547
1548
1549
# File 'lib/kamelopard/classes.rb', line 1547

def lod
  @lod
end

Instance Method Details

#to_kml(indent = 0) ⇒ Object



1555
1556
1557
1558
1559
1560
1561
# File 'lib/kamelopard/classes.rb', line 1555

def to_kml(indent = 0)
    k = "#{' ' * indent}<Region id=\"#{@id}\">\n"
    k << @latlonaltbox.to_kml(indent + 4, true) unless @latlonaltbox.nil?
    k << @lod.to_kml(indent + 4) unless @lod.nil?
    k << "#{' ' * indent}</Region>\n"
    k
end