Class: Clowne::Utils::Plan::TwoPhaseSet
- Inherits:
-
Object
- Object
- Clowne::Utils::Plan::TwoPhaseSet
- Defined in:
- lib/clowne/utils/plan.rb
Instance Method Summary collapse
- #[]=(k, v) ⇒ Object
- #delete(k) ⇒ Object
-
#initialize ⇒ TwoPhaseSet
constructor
A new instance of TwoPhaseSet.
- #values ⇒ Object
Constructor Details
#initialize ⇒ TwoPhaseSet
Returns a new instance of TwoPhaseSet.
7 8 9 10 |
# File 'lib/clowne/utils/plan.rb', line 7 def initialize @added = {} @removed = [] end |
Instance Method Details
#[]=(k, v) ⇒ Object
12 13 14 15 16 |
# File 'lib/clowne/utils/plan.rb', line 12 def []=(k, v) return if @removed.include?(k) @added[k] = v end |
#delete(k) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/clowne/utils/plan.rb', line 18 def delete(k) return if @removed.include?(k) @removed << k @added.delete(k) end |
#values ⇒ Object
25 26 27 |
# File 'lib/clowne/utils/plan.rb', line 25 def values @added.values end |