Class: Kamelopard::StyleSelector

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

Overview

Abstract class corresponding to KML’s StyleSelector object.

Direct Known Subclasses

Style, StyleMap

Instance Attribute Summary collapse

Attributes inherited from Object

#comment, #id

Instance Method Summary collapse

Constructor Details

#initializeStyleSelector

Returns a new instance of StyleSelector.



1068
1069
1070
1071
1072
# File 'lib/kamelopard/classes.rb', line 1068

def initialize
    super
    @attached = false
    Document.instance.styles << self
end

Instance Attribute Details

#attachedObject

Returns the value of attribute attached.



1067
1068
1069
# File 'lib/kamelopard/classes.rb', line 1067

def attached
  @attached
end

Instance Method Details

#attach(obj) ⇒ Object



1078
1079
1080
1081
# File 'lib/kamelopard/classes.rb', line 1078

def attach(obj)
    @attached = true
    obj.styles << self
end

#attached?Boolean

Returns:

  • (Boolean)


1074
1075
1076
# File 'lib/kamelopard/classes.rb', line 1074

def attached?
    @attached
end

#to_kml(elem = nil) ⇒ Object



1083
1084
1085
1086
1087
# File 'lib/kamelopard/classes.rb', line 1083

def to_kml(elem = nil)
    elem = REXML::Element.new 'StyleSelector' if elem.nil?
    super elem
    elem
end