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

Attributes inherited from Object

#comment, #kml_id, #master_only

Instance Method Summary collapse

Methods inherited from Object

#_alternate_to_kml, #change, #master_only?, parse

Constructor Details

#initialize(options = {}) ⇒ StyleSelector

Returns a new instance of StyleSelector.



1665
1666
1667
1668
1669
# File 'lib/kamelopard/classes.rb', line 1665

def initialize(options = {})
    super
    @attached = false
    DocumentHolder.instance.current_document.styles << self
end

Instance Method Details

#attach(obj) ⇒ Object



1675
1676
1677
1678
# File 'lib/kamelopard/classes.rb', line 1675

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

#attached?Boolean

Returns:

  • (Boolean)


1671
1672
1673
# File 'lib/kamelopard/classes.rb', line 1671

def attached?
    @attached
end

#to_kml(elem = nil) ⇒ Object



1680
1681
1682
1683
1684
# File 'lib/kamelopard/classes.rb', line 1680

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