Class: GeoCli::FeatureCollection
- Inherits:
-
Object
- Object
- GeoCli::FeatureCollection
- Defined in:
- lib/geo-cli/geom_reader.rb
Instance Attribute Summary collapse
-
#entities ⇒ Object
readonly
Returns the value of attribute entities.
Instance Method Summary collapse
-
#initialize(entities) ⇒ FeatureCollection
constructor
A new instance of FeatureCollection.
- #to_geojson ⇒ Object
Constructor Details
#initialize(entities) ⇒ FeatureCollection
Returns a new instance of FeatureCollection.
81 82 83 |
# File 'lib/geo-cli/geom_reader.rb', line 81 def initialize(entities) @entities = entities end |
Instance Attribute Details
#entities ⇒ Object (readonly)
Returns the value of attribute entities.
80 81 82 |
# File 'lib/geo-cli/geom_reader.rb', line 80 def entities @entities end |
Instance Method Details
#to_geojson ⇒ Object
85 86 87 88 |
# File 'lib/geo-cli/geom_reader.rb', line 85 def to_geojson {type: "FeatureCollection", features: entities.map { |e| e.as_geojson(true) } }.to_json end |