Class: KML::Folder

Inherits:
Container show all
Defined in:
lib/kml/folder.rb

Overview

A Folder is used to arrange other Features hierarchically (Folders, Placemarks, NetworkLinks, or Overlays). A Feature is visible only if it and all its ancestors are visible.

Instance Attribute Summary

Attributes inherited from Container

#features, #plain_children

Attributes inherited from Feature

#address, #address_details, #description, #look_at, #metadata, #name, #phone_number, #region, #snippet, #style_selector, #style_url, #time_primitive

Attributes inherited from Object

#id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Feature

#open, #open=, #open?, #visibility, #visibility=, #visibility?

Methods inherited from Object

#initialize

Constructor Details

This class inherits a constructor from KML::Object

Class Method Details

.parse(node) ⇒ Object



12
13
14
# File 'lib/kml/folder.rb', line 12

def self.parse(node)
  self.new.parse(node)
end

Instance Method Details

#parse(node) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/kml/folder.rb', line 16

def parse(node)
  super(node) do |cld|
    case cld.name
    when 'Stylex'
    when 'Schemax'
    else
      puts "Folder"
      p cld
      puts
    end
  end
end

#render(xm = Builder::XmlMarkup.new(:indent => 2)) ⇒ Object



5
6
7
8
9
10
# File 'lib/kml/folder.rb', line 5

def render(xm=Builder::XmlMarkup.new(:indent => 2))
  xm.Folder {
    super
    features.each { |f| f.render(xm) }
  }
end