Module: DreddHooks::Runner
- Defined in:
- lib/dredd_hooks/runner.rb
Class Method Summary collapse
- .run_after_all_hooks_for_transactions(transactions) ⇒ Object
- .run_after_each_hooks_for_transaction(transaction) ⇒ Object
- .run_after_hooks_for_transaction(transaction) ⇒ Object
-
.run_before_all_hooks_for_transactions(transactions) ⇒ Object
Runners for *_all hooks API.
-
.run_before_each_hooks_for_transaction(transaction) ⇒ Object
Runners for *_each hooks API.
- .run_before_each_validation_hooks_for_transaction(transaction) ⇒ Object
-
.run_before_hooks_for_transaction(transaction) ⇒ Object
Runers for Transaction specific hooks.
- .run_before_validation_hooks_for_transaction(transaction) ⇒ Object
Class Method Details
.run_after_all_hooks_for_transactions(transactions) ⇒ Object
77 78 79 80 81 82 |
# File 'lib/dredd_hooks/runner.rb', line 77 def self.run_after_all_hooks_for_transactions transactions Methods.class_variable_get("@@after_all_hooks").each do |hook_proc| hook_proc.call transactions end return transactions end |
.run_after_each_hooks_for_transaction(transaction) ⇒ Object
59 60 61 62 63 64 |
# File 'lib/dredd_hooks/runner.rb', line 59 def self.run_after_each_hooks_for_transaction transaction Methods.class_variable_get("@@after_each_hooks").each do |hook_proc| hook_proc.call transaction end return transaction end |
.run_after_hooks_for_transaction(transaction) ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/dredd_hooks/runner.rb', line 30 def self.run_after_hooks_for_transaction transaction transaction_name = transaction["name"] hooks = Methods.class_variable_get("@@after_hooks")[transaction_name] if hooks.kind_of? Array hooks.each do |hook_proc| hook_proc.call transaction end end return transaction end |
.run_before_all_hooks_for_transactions(transactions) ⇒ Object
Runners for *_all hooks API
70 71 72 73 74 75 |
# File 'lib/dredd_hooks/runner.rb', line 70 def self.run_before_all_hooks_for_transactions transactions Methods.class_variable_get("@@before_all_hooks").each do |hook_proc| hook_proc.call transactions end return transactions end |
.run_before_each_hooks_for_transaction(transaction) ⇒ Object
Runners for *_each hooks API
45 46 47 48 49 50 |
# File 'lib/dredd_hooks/runner.rb', line 45 def self.run_before_each_hooks_for_transaction transaction Methods.class_variable_get("@@before_each_hooks").each do |hook_proc| hook_proc.call transaction end return transaction end |
.run_before_each_validation_hooks_for_transaction(transaction) ⇒ Object
52 53 54 55 56 57 |
# File 'lib/dredd_hooks/runner.rb', line 52 def self.run_before_each_validation_hooks_for_transaction transaction Methods.class_variable_get("@@before_each_validation_hooks").each do |hook_proc| hook_proc.call transaction end return transaction end |
.run_before_hooks_for_transaction(transaction) ⇒ Object
Runers for Transaction specific hooks
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/dredd_hooks/runner.rb', line 8 def self.run_before_hooks_for_transaction transaction transaction_name = transaction["name"] hooks = Methods.class_variable_get("@@before_hooks")[transaction_name] if hooks.kind_of? Array hooks.each do |hook_proc| hook_proc.call transaction end end return transaction end |
.run_before_validation_hooks_for_transaction(transaction) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/dredd_hooks/runner.rb', line 19 def self.run_before_validation_hooks_for_transaction transaction transaction_name = transaction["name"] hooks = Methods.class_variable_get("@@before_validation_hooks")[transaction_name] if hooks.kind_of? Array hooks.each do |hook_proc| hook_proc.call transaction end end return transaction end |