Class: Kamelopard::MultiGeometry

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

Instance Attribute Summary collapse

Attributes inherited from Object

#comment, #kml_id

Instance Method Summary collapse

Methods inherited from Object

#change

Constructor Details

#initialize(a = nil, options = {}) ⇒ MultiGeometry

Returns a new instance of MultiGeometry.



1973
1974
1975
1976
1977
# File 'lib/kamelopard/classes.rb', line 1973

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

Instance Attribute Details

#geometriesObject

Returns the value of attribute geometries.



1971
1972
1973
# File 'lib/kamelopard/classes.rb', line 1971

def geometries
  @geometries
end

Instance Method Details

#<<(a) ⇒ Object



1979
1980
1981
# File 'lib/kamelopard/classes.rb', line 1979

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

#to_kml(elem = nil) ⇒ Object



1983
1984
1985
1986
1987
1988
1989
1990
# File 'lib/kamelopard/classes.rb', line 1983

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