Class: JsonDiff::IndexMaps
- Inherits:
-
Object
- Object
- JsonDiff::IndexMaps
- Defined in:
- lib/json-diff/index-map.rb
Instance Method Summary collapse
- #addition(index) ⇒ Object
-
#initialize ⇒ IndexMaps
constructor
A new instance of IndexMaps.
- #map(index) ⇒ Object
- #removal(index) ⇒ Object
Constructor Details
#initialize ⇒ IndexMaps
Returns a new instance of IndexMaps.
4 5 6 |
# File 'lib/json-diff/index-map.rb', line 4 def initialize @maps = [] end |
Instance Method Details
#addition(index) ⇒ Object
8 9 10 |
# File 'lib/json-diff/index-map.rb', line 8 def addition(index) @maps << AdditionIndexMap.new(index) end |
#map(index) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/json-diff/index-map.rb', line 16 def map(index) @maps.each do |map| index = map.map(index) end index end |
#removal(index) ⇒ Object
12 13 14 |
# File 'lib/json-diff/index-map.rb', line 12 def removal(index) @maps << RemovalIndexMap.new(index) end |