Class: Style
- Inherits:
-
StyleSelector
- Object
- KMLObject
- StyleSelector
- Style
- 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
-
#balloon ⇒ Object
Returns the value of attribute balloon.
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#label ⇒ Object
Returns the value of attribute label.
-
#line ⇒ Object
Returns the value of attribute line.
-
#list ⇒ Object
Returns the value of attribute list.
-
#poly ⇒ Object
Returns the value of attribute poly.
Attributes inherited from StyleSelector
Attributes inherited from KMLObject
Instance Method Summary collapse
-
#initialize(icon = nil, label = nil, line = nil, poly = nil, balloon = nil, list = nil) ⇒ Style
constructor
A new instance of Style.
- #to_kml(indent = 0) ⇒ Object
Methods inherited from StyleSelector
Constructor Details
#initialize(icon = nil, label = nil, line = nil, poly = nil, balloon = nil, list = nil) ⇒ Style
Returns a new instance of Style.
1024 1025 1026 1027 1028 1029 1030 1031 1032 |
# File 'lib/kamelopard/classes.rb', line 1024 def initialize(icon = nil, label = nil, line = nil, poly = nil, balloon = nil, list = nil) super() @icon = icon @label = label @line = line @poly = poly @balloon = balloon @list = list end |
Instance Attribute Details
#balloon ⇒ Object
Returns the value of attribute balloon.
1023 1024 1025 |
# File 'lib/kamelopard/classes.rb', line 1023 def balloon @balloon end |
#icon ⇒ Object
Returns the value of attribute icon.
1023 1024 1025 |
# File 'lib/kamelopard/classes.rb', line 1023 def icon @icon end |
#label ⇒ Object
Returns the value of attribute label.
1023 1024 1025 |
# File 'lib/kamelopard/classes.rb', line 1023 def label @label end |
#line ⇒ Object
Returns the value of attribute line.
1023 1024 1025 |
# File 'lib/kamelopard/classes.rb', line 1023 def line @line end |
#list ⇒ Object
Returns the value of attribute list.
1023 1024 1025 |
# File 'lib/kamelopard/classes.rb', line 1023 def list @list end |
#poly ⇒ Object
Returns the value of attribute poly.
1023 1024 1025 |
# File 'lib/kamelopard/classes.rb', line 1023 def poly @poly end |
Instance Method Details
#to_kml(indent = 0) ⇒ Object
1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 |
# File 'lib/kamelopard/classes.rb', line 1034 def to_kml(indent = 0) k = '' k << super + "#{ ' ' * indent }<Style id=\"#{@id}\">\n" k << @icon.to_kml(indent + 4) unless @icon.nil? k << @label.to_kml(indent + 4) unless @label.nil? k << @line.to_kml(indent + 4) unless @line.nil? k << @poly.to_kml(indent + 4) unless @poly.nil? k << @balloon.to_kml(indent + 4) unless @balloon.nil? k << @list.to_kml(indent + 4) unless @list.nil? k << "#{ ' ' * indent }</Style>\n" k end |