Class: Kamelopard::Style

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

Overview

Corresponds to KML’s Style object. Attributes are expected to be IconStyle, LabelStyle, LineStyle, PolyStyle, BalloonStyle, and ListStyle objects.

Instance Attribute Summary collapse

Attributes inherited from Object

#comment, #kml_id, #master_only

Instance Method Summary collapse

Methods inherited from StyleSelector

#attach, #attached?, #initialize

Methods inherited from Object

#_alternate_to_kml, #change, #initialize, #master_only?, parse

Constructor Details

This class inherits a constructor from Kamelopard::StyleSelector

Instance Attribute Details

#balloonObject

Returns the value of attribute balloon.



1634
1635
1636
# File 'lib/kamelopard/classes.rb', line 1634

def balloon
  @balloon
end

#iconObject

Returns the value of attribute icon.



1634
1635
1636
# File 'lib/kamelopard/classes.rb', line 1634

def icon
  @icon
end

#labelObject

Returns the value of attribute label.



1634
1635
1636
# File 'lib/kamelopard/classes.rb', line 1634

def label
  @label
end

#lineObject

Returns the value of attribute line.



1634
1635
1636
# File 'lib/kamelopard/classes.rb', line 1634

def line
  @line
end

#listObject

Returns the value of attribute list.



1634
1635
1636
# File 'lib/kamelopard/classes.rb', line 1634

def list
  @list
end

#polyObject

Returns the value of attribute poly.



1634
1635
1636
# File 'lib/kamelopard/classes.rb', line 1634

def poly
  @poly
end

Instance Method Details

#to_kml(elem = nil) ⇒ Object



1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
# File 'lib/kamelopard/classes.rb', line 1636

def to_kml(elem = nil)
    k = XML::Node.new 'Style'
    super k
    @icon.to_kml(k) unless @icon.nil?
    @label.to_kml(k) unless @label.nil?
    @line.to_kml(k) unless @line.nil?
    @poly.to_kml(k) unless @poly.nil?
    @balloon.to_kml(k) unless @balloon.nil?
    @list.to_kml(k) unless @list.nil?
    elem << k unless elem.nil?
    k
end