Class: Gluer::RegistrationPool

Inherits:
Object
  • Object
show all
Defined in:
lib/gluer/registration_pool.rb

Instance Method Summary collapse

Constructor Details

#initializeRegistrationPool

Returns a new instance of RegistrationPool.



3
4
5
# File 'lib/gluer/registration_pool.rb', line 3

def initialize
  clear
end

Instance Method Details

#add(registration) ⇒ Object



15
16
17
# File 'lib/gluer/registration_pool.rb', line 15

def add(registration)
  registrations.push(registration)
end

#clearObject



23
24
25
# File 'lib/gluer/registration_pool.rb', line 23

def clear
  @registrations = []
end

#commitObject



7
8
9
# File 'lib/gluer/registration_pool.rb', line 7

def commit
  registrations.each(&:commit)
end

#replace(registration_pool) ⇒ Object



19
20
21
# File 'lib/gluer/registration_pool.rb', line 19

def replace(registration_pool)
  @registrations = registration_pool.registrations
end

#rollbackObject



11
12
13
# File 'lib/gluer/registration_pool.rb', line 11

def rollback
  registrations.each(&:rollback)
end