Class: GeoRuby::SimpleFeatures::FeatureCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/geojson.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(features = []) ⇒ FeatureCollection

Returns a new instance of FeatureCollection.



138
139
140
# File 'lib/geojson.rb', line 138

def initialize(features=[])
  @features=features
end

Instance Attribute Details

#featuresObject

Returns the value of attribute features.



137
138
139
# File 'lib/geojson.rb', line 137

def features
  @features
end

Instance Method Details

#==(other) ⇒ Object



147
148
149
150
151
152
153
# File 'lib/geojson.rb', line 147

def ==(other)
  if other.class != self.class
    false
  else
    @features==other.features
  end
end

#as_json(options = nil) ⇒ Object



142
143
144
145
# File 'lib/geojson.rb', line 142

def as_json(options = nil)
  {:type=>"FeatureCollection",
    :features=>@features}.as_json(options)
end