Method: OpenStreetMap::Element#attributes

Defined in:
lib/open_street_map/element.rb

#attributesObject

Returns a hash of all non-nil attributes of this object.

Keys of this hash are :id, :user, and :timestamp. For a Node also :lon and :lat.

call-seq: attributes -> Hash



76
77
78
79
80
81
82
83
# File 'lib/open_street_map/element.rb', line 76

def attributes
  attrs = Hash.new
  attribute_list.each do |attribute|
    value = self.send(attribute)
    attrs[attribute] = value unless value.nil?
  end
  attrs
end