Skip to content

Commit

Permalink
Helper function to return WebHook object
Browse files Browse the repository at this point in the history
  • Loading branch information
mloughran committed Nov 12, 2012
1 parent 9804176 commit e7a911f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/pusher.rb
Expand Up @@ -32,6 +32,7 @@ class << self

def_delegators :default_client, :get, :get_async, :post, :post_async
def_delegators :default_client, :channels, :channel_info, :trigger
def_delegators :default_client, :webhook

attr_writer :logger

Expand Down
6 changes: 6 additions & 0 deletions lib/pusher/client.rb
Expand Up @@ -96,6 +96,12 @@ def post_async(path, params = {})
Resource.new(self, path).post_async(params)
end

## HELPER FUNCTIONS

def webhook(request)
WebHook.new(request, self)
end

# Return a convenience channel object by name. No API request is made.
#
# @example
Expand Down

0 comments on commit e7a911f

Please sign in to comment.