Class: KML::Object
- Inherits:
-
Object
- Object
- KML::Object
- Defined in:
- lib/kml/object.rb
Overview
Base class for all KML objects
Direct Known Subclasses
ColorStyle, Feature, Geometry, LatLonBox, Link, LookAt, StyleSelector
Instance Attribute Summary collapse
-
#id ⇒ Object
The KML object ID.
Instance Method Summary collapse
-
#initialize(attributes = nil) ⇒ Object
constructor
Initialize the object, optionally passing a Hash of attributes to set.
Constructor Details
#initialize(attributes = nil) ⇒ Object
Initialize the object, optionally passing a Hash of attributes to set.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/kml/object.rb', line 8 def initialize(attributes=nil) if attributes case attributes when Hash attributes.each do |name, value| self.__send__("#{name}=".to_sym, value) end else raise ArgumentError, "Attributes must be specified as a Hash" end end end |