Class: Hyalite::Updates::NestedUpdate

Inherits:
Object
  • Object
show all
Includes:
TransactionWrapper
Defined in:
lib/hyalite/updates.rb

Instance Method Summary collapse

Constructor Details

#initialize(dirty_components) ⇒ NestedUpdate

Returns a new instance of NestedUpdate.



11
12
13
# File 'lib/hyalite/updates.rb', line 11

def initialize(dirty_components)
  @dirty_components = dirty_components
end

Instance Method Details

#closeObject



19
20
21
22
23
24
25
# File 'lib/hyalite/updates.rb', line 19

def close
  if @dirty_components.length - @init_length > 0
    @dirty_components.shift(@init_length)
  else
    @dirty_components.clear
  end
end

#initObject



15
16
17
# File 'lib/hyalite/updates.rb', line 15

def init
  @init_length = @dirty_components.length
end