Class: Gluer::RegistrationPool
- Inherits:
-
Object
- Object
- Gluer::RegistrationPool
- Defined in:
- lib/gluer/registration_pool.rb
Instance Method Summary collapse
- #add(registration) ⇒ Object
- #clear ⇒ Object
- #commit ⇒ Object
-
#initialize ⇒ RegistrationPool
constructor
A new instance of RegistrationPool.
- #replace(registration_pool) ⇒ Object
- #rollback ⇒ Object
Constructor Details
#initialize ⇒ RegistrationPool
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 |
#clear ⇒ Object
23 24 25 |
# File 'lib/gluer/registration_pool.rb', line 23 def clear @registrations = [] end |
#commit ⇒ Object
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 |
#rollback ⇒ Object
11 12 13 |
# File 'lib/gluer/registration_pool.rb', line 11 def rollback registrations.each(&:rollback) end |