Class: LineStyle
- Inherits:
-
ColorStyle
- Object
- KMLObject
- ColorStyle
- LineStyle
- Defined in:
- lib/kamelopard/classes.rb
Overview
Corresponds to KML’s LineStyle object. Color is stored as an 8-character hex string, with two characters each of alpha, blue, green, and red values, in that order, matching the ordering the KML spec demands.
Instance Attribute Summary collapse
-
#outercolor ⇒ Object
Returns the value of attribute outercolor.
-
#outerwidth ⇒ Object
Returns the value of attribute outerwidth.
-
#physicalwidth ⇒ Object
Returns the value of attribute physicalwidth.
-
#width ⇒ Object
Returns the value of attribute width.
Attributes inherited from ColorStyle
Attributes inherited from KMLObject
Instance Method Summary collapse
-
#initialize(width = 1, outercolor = 'ffffffff', outerwidth = 0, physicalwidth = 0, color = 'ffffffff', colormode = :normal) ⇒ LineStyle
constructor
A new instance of LineStyle.
- #to_kml(indent = 0) ⇒ Object
Methods inherited from ColorStyle
#alpha, #alpha=, #blue, #blue=, #green, #green=, #red, #red=, #validate_colormode
Constructor Details
#initialize(width = 1, outercolor = 'ffffffff', outerwidth = 0, physicalwidth = 0, color = 'ffffffff', colormode = :normal) ⇒ LineStyle
Returns a new instance of LineStyle.
923 924 925 926 927 928 929 |
# File 'lib/kamelopard/classes.rb', line 923 def initialize(width = 1, outercolor = 'ffffffff', outerwidth = 0, physicalwidth = 0, color = 'ffffffff', colormode = :normal) super(color, colormode) @width = width @outercolor = outercolor @outerwidth = outerwidth @physicalwidth = physicalwidth end |
Instance Attribute Details
#outercolor ⇒ Object
Returns the value of attribute outercolor.
921 922 923 |
# File 'lib/kamelopard/classes.rb', line 921 def outercolor @outercolor end |
#outerwidth ⇒ Object
Returns the value of attribute outerwidth.
921 922 923 |
# File 'lib/kamelopard/classes.rb', line 921 def outerwidth @outerwidth end |
#physicalwidth ⇒ Object
Returns the value of attribute physicalwidth.
921 922 923 |
# File 'lib/kamelopard/classes.rb', line 921 def physicalwidth @physicalwidth end |
#width ⇒ Object
Returns the value of attribute width.
921 922 923 |
# File 'lib/kamelopard/classes.rb', line 921 def width @width end |
Instance Method Details
#to_kml(indent = 0) ⇒ Object
931 932 933 934 935 936 937 938 939 940 941 942 |
# File 'lib/kamelopard/classes.rb', line 931 def to_kml(indent = 0) <<-linestyle #{ ' ' * indent }<LineStyle id="#{@id}"> #{ super(indent + 4) } #{ ' ' * indent } <width>#{@width}</width> #{ ' ' * indent } <gx:outerColor>#{@outercolor}</gx:outerColor> #{ ' ' * indent } <gx:outerWidth>#{@outerwidth}</gx:outerWidth> #{ ' ' * indent } <gx:physicalWidth>#{@physicalwidth}</gx:physicalWidth> #{ ' ' * indent }</LineStyle> linestyle end |