Class: GeoRuby::SimpleFeatures::FeatureCollection
- Inherits:
-
Object
- Object
- GeoRuby::SimpleFeatures::FeatureCollection
- Defined in:
- lib/geojson.rb
Instance Attribute Summary collapse
-
#features ⇒ Object
Returns the value of attribute features.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #as_json(options = nil) ⇒ Object
-
#initialize(features = []) ⇒ FeatureCollection
constructor
A new instance of FeatureCollection.
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
#features ⇒ Object
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( = nil) {:type=>"FeatureCollection", :features=>@features}.as_json() end |