Class: Gwooks::Base
- Inherits:
-
Object
- Object
- Gwooks::Base
- Defined in:
- lib/gwooks/base.rb
Constant Summary collapse
- DSL_METHODS =
%w( after before branch commits_added commits_author_email commits_author_name commits_id commits_message commits_modified commits_removed commits_timestamp commits_url ref repository_description repository_forks repository_homepage repository_name repository_owner_email repository_owner_name repository_pledgie repository_private repository_url repository_watchers )
Instance Attribute Summary collapse
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(payload) ⇒ Base
constructor
A new instance of Base.
Constructor Details
Instance Attribute Details
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
71 72 73 |
# File 'lib/gwooks/base.rb', line 71 def payload @payload end |
Class Method Details
.call(payload) ⇒ Object
33 34 35 |
# File 'lib/gwooks/base.rb', line 33 def call(payload) new(payload).call end |
.hooks ⇒ Object
37 38 39 |
# File 'lib/gwooks/base.rb', line 37 def hooks @_hooks ||= [] end |
.payload_matches(key, pattern, &block) ⇒ Object
41 42 43 44 |
# File 'lib/gwooks/base.rb', line 41 def payload_matches(key, pattern, &block) @_hooks ||= [] @_hooks << [key, pattern, block] end |
Instance Method Details
#call ⇒ Object
77 78 79 80 81 82 83 |
# File 'lib/gwooks/base.rb', line 77 def call self.class.hooks.each do |hook| key, pattern, block = *hook exec_if_matching( key, pattern, &block ) end nil end |