Class: KML::Object

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

Instance Attribute Details

#idObject

The KML object ID



5
6
7
# File 'lib/kml/object.rb', line 5

def id
  @id
end