Class: PostCommit::Hooks::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/post_commit/hooks/base.rb

Direct Known Subclasses

Basecamp, Campfire, FriendFeed, LightHouse, Twitter, URL

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

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

#credentialsObject

Hold the authorization options.



5
6
7
# File 'lib/post_commit/hooks/base.rb', line 5

def credentials
  @credentials
end

#requestObject (readonly)

Hold the latest request object



11
12
13
# File 'lib/post_commit/hooks/base.rb', line 11

def request
  @request
end

#responseObject (readonly)

Hold the latest response



8
9
10
# File 'lib/post_commit/hooks/base.rb', line 8

def response
  @response
end

#uriObject (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 authorize(options = {})
  @credentials = options
end

#post(options = {}) ⇒ Object

:nodoc:



30
31
32
# File 'lib/post_commit/hooks/base.rb', line 30

def post(options = {}) # :nodoc:
  raise PostCommit::AbstractMethodError
end