Class: Kamelopard::StyleSelector
- Defined in:
- lib/kamelopard/classes.rb
Overview
Abstract class corresponding to KML’s StyleSelector object.
Instance Attribute Summary
Attributes inherited from Object
#comment, #kml_id, #master_only
Instance Method Summary collapse
- #attach(obj) ⇒ Object
- #attached? ⇒ Boolean
-
#initialize(options = {}) ⇒ StyleSelector
constructor
A new instance of StyleSelector.
- #to_kml(elem = nil) ⇒ Object
Methods inherited from Object
#_alternate_to_kml, #change, #master_only?, parse
Constructor Details
#initialize(options = {}) ⇒ StyleSelector
Returns a new instance of StyleSelector.
1666 1667 1668 1669 1670 |
# File 'lib/kamelopard/classes.rb', line 1666 def initialize( = {}) super @attached = false DocumentHolder.instance.current_document.styles << self end |
Instance Method Details
#attach(obj) ⇒ Object
1676 1677 1678 1679 |
# File 'lib/kamelopard/classes.rb', line 1676 def attach(obj) @attached = true obj.styles << self end |
#attached? ⇒ Boolean
1672 1673 1674 |
# File 'lib/kamelopard/classes.rb', line 1672 def attached? @attached end |
#to_kml(elem = nil) ⇒ Object
1681 1682 1683 1684 1685 |
# File 'lib/kamelopard/classes.rb', line 1681 def to_kml(elem = nil) elem = XML::Node.new 'StyleSelector' if elem.nil? super elem elem end |