Class: GeojsonDiff
- Inherits:
-
Object
- Object
- GeojsonDiff
- Defined in:
- lib/geojson-diff.rb,
lib/geojson-diff/version.rb,
lib/geojson-diff/property-diff.rb
Defined Under Namespace
Classes: PropertyDiff
Constant Summary collapse
- META_KEY =
'_geojson_diff'
- VERSION =
'0.0.1'
Instance Attribute Summary collapse
-
#after ⇒ Object
Returns the value of attribute after.
-
#before ⇒ Object
Returns the value of attribute before.
Instance Method Summary collapse
- #added ⇒ Object
-
#initialize(before, after) ⇒ GeojsonDiff
constructor
A new instance of GeojsonDiff.
- #removed ⇒ Object
- #unchanged ⇒ Object
Constructor Details
#initialize(before, after) ⇒ GeojsonDiff
Returns a new instance of GeojsonDiff.
15 16 17 18 |
# File 'lib/geojson-diff.rb', line 15 def initialize(before, after) @before = ensure_feature_collection(RGeo::GeoJSON.decode(before, :json_parser => :json)) @after = ensure_feature_collection(RGeo::GeoJSON.decode(after, :json_parser => :json)) end |
Instance Attribute Details
#after ⇒ Object
Returns the value of attribute after.
20 21 22 |
# File 'lib/geojson-diff.rb', line 20 def after @after end |
#before ⇒ Object
Returns the value of attribute before.
20 21 22 |
# File 'lib/geojson-diff.rb', line 20 def before @before end |
Instance Method Details
#added ⇒ Object
22 23 24 |
# File 'lib/geojson-diff.rb', line 22 def added diff(@after,@before,"added") end |
#removed ⇒ Object
26 27 28 |
# File 'lib/geojson-diff.rb', line 26 def removed diff(@before,@after,"removed") end |
#unchanged ⇒ Object
30 31 32 |
# File 'lib/geojson-diff.rb', line 30 def unchanged diff(@before,@after,"unchanged") end |