Class: Kamelopard::MultiGeometry

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

Overview

Abstract class corresponding to KML’s MultiGeometry object

Instance Attribute Summary collapse

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(a = nil, options = {}) ⇒ MultiGeometry

Returns a new instance of MultiGeometry.



2470
2471
2472
2473
2474
# File 'lib/kamelopard/classes.rb', line 2470

def initialize(a = nil, options = {})
    @geometries = []
    @geometries << a unless a.nil?
    super options
end

Instance Attribute Details

#geometriesObject

Returns the value of attribute geometries.



2468
2469
2470
# File 'lib/kamelopard/classes.rb', line 2468

def geometries
  @geometries
end

Instance Method Details

#<<(a) ⇒ Object



2476
2477
2478
# File 'lib/kamelopard/classes.rb', line 2476

def <<(a)
    @geometries << a
end

#to_kml(elem = nil) ⇒ Object



2480
2481
2482
2483
2484
2485
2486
2487
# File 'lib/kamelopard/classes.rb', line 2480

def to_kml(elem = nil)
    e = XML::Node.new 'MultiGeometry'
    @geometries.each do |g|
        g.to_kml e
    end
    elem << e unless elem.nil?
    e
end