Class: PostCommit::Hooks::Base
- Inherits:
-
Object
- Object
- PostCommit::Hooks::Base
- Defined in:
- lib/post_commit/hooks/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#credentials ⇒ Object
Hold the authorization options.
-
#request ⇒ Object
readonly
Hold the latest request object.
-
#response ⇒ Object
readonly
Hold the latest response.
-
#uri ⇒ Object
readonly
Hold the latest uri object.
Class Method Summary collapse
Instance Method Summary collapse
-
#authorize(options = {}) ⇒ Object
Set up the authorization for the current notifier.
-
#initialize ⇒ Base
constructor
A new instance of Base.
-
#post(options = {}) ⇒ Object
:nodoc:.
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
16 17 18 |
# File 'lib/post_commit/hooks/base.rb', line 16 def initialize @credentials = {} end |
Instance Attribute Details
#credentials ⇒ Object
Hold the authorization options.
5 6 7 |
# File 'lib/post_commit/hooks/base.rb', line 5 def credentials @credentials end |
#request ⇒ Object (readonly)
Hold the latest request object
11 12 13 |
# File 'lib/post_commit/hooks/base.rb', line 11 def request @request end |
#response ⇒ Object (readonly)
Hold the latest response
8 9 10 |
# File 'lib/post_commit/hooks/base.rb', line 8 def response @response end |
#uri ⇒ Object (readonly)
Hold the latest uri object
14 15 16 |
# File 'lib/post_commit/hooks/base.rb', line 14 def uri @uri end |
Class Method Details
.inherited(base) ⇒ Object
20 21 22 |
# File 'lib/post_commit/hooks/base.rb', line 20 def self.inherited(base) PostCommit::Hooks.register base.name.split("::").last.downcase.to_sym, base end |
Instance Method Details
#authorize(options = {}) ⇒ Object
Set up the authorization for the current notifier. Each notifier can have its own authorization options.
26 27 28 |
# File 'lib/post_commit/hooks/base.rb', line 26 def ( = {}) @credentials = end |
#post(options = {}) ⇒ Object
:nodoc:
30 31 32 |
# File 'lib/post_commit/hooks/base.rb', line 30 def post( = {}) # :nodoc: raise PostCommit::AbstractMethodError end |