Class: Gluer::RegistrationDefinition
- Inherits:
-
Object
- Object
- Gluer::RegistrationDefinition
- Defined in:
- lib/gluer/registration_definition.rb
Instance Attribute Summary collapse
-
#commit_hook ⇒ Object
readonly
Returns the value of attribute commit_hook.
-
#registry_factory ⇒ Object
readonly
Returns the value of attribute registry_factory.
-
#rollback_hook ⇒ Object
readonly
Returns the value of attribute rollback_hook.
Instance Method Summary collapse
-
#initialize(name) ⇒ RegistrationDefinition
constructor
A new instance of RegistrationDefinition.
- #on_commit(&block) ⇒ Object
- #on_rollback(&block) ⇒ Object
- #registry(&block) ⇒ Object
Constructor Details
#initialize(name) ⇒ RegistrationDefinition
Returns a new instance of RegistrationDefinition.
3 4 5 |
# File 'lib/gluer/registration_definition.rb', line 3 def initialize(name) @name = name end |
Instance Attribute Details
#commit_hook ⇒ Object (readonly)
Returns the value of attribute commit_hook.
19 20 21 |
# File 'lib/gluer/registration_definition.rb', line 19 def commit_hook @commit_hook end |
#registry_factory ⇒ Object (readonly)
Returns the value of attribute registry_factory.
19 20 21 |
# File 'lib/gluer/registration_definition.rb', line 19 def registry_factory @registry_factory end |
#rollback_hook ⇒ Object (readonly)
Returns the value of attribute rollback_hook.
19 20 21 |
# File 'lib/gluer/registration_definition.rb', line 19 def rollback_hook @rollback_hook end |
Instance Method Details
#on_commit(&block) ⇒ Object
7 8 9 |
# File 'lib/gluer/registration_definition.rb', line 7 def on_commit(&block) @commit_hook = RegistrationHook.new(block) end |
#on_rollback(&block) ⇒ Object
11 12 13 |
# File 'lib/gluer/registration_definition.rb', line 11 def on_rollback(&block) @rollback_hook = RegistrationHook.new(block) end |
#registry(&block) ⇒ Object
15 16 17 |
# File 'lib/gluer/registration_definition.rb', line 15 def registry(&block) @registry_factory = block end |