Permalink
Browse files

Standardise on params over options for api params

This is the terminology in the REST API so this makes the gem consistent
  • Loading branch information...
1 parent 3425798 commit fb52cfa5e819010a3abdfc86e1913f551edc5691 @mloughran mloughran committed Nov 9, 2012
Showing with 12 additions and 12 deletions.
  1. +11 −11 lib/pusher/client.rb
  2. +1 −1 spec/client_spec.rb
View
@@ -124,27 +124,27 @@ def channel(channel_name)
#
# GET /apps/[id]/channels
#
- # @param options [Hash] Hash of options for the API - see Pusher API docs
+ # @param params [Hash] Hash of parameters for the API - see REST API docs
# @return [Hash] See Pusher API docs
# @raise [Pusher::Error] on invalid Pusher response - see the error message for more details
# @raise [Pusher::HTTPError] on any error raised inside Net::HTTP - the original error is available in the original_error attribute
#
- def channels(options = {})
- get('/channels', options)
+ def channels(params = {})
+ get('/channels', params)
end
# Request info for a specific channel
#
# GET /apps/[id]/channels/[channel_name]
#
# @param channel_name [String] Channel name
- # @param options [Hash] Hash of options for the API - see Pusher API docs
+ # @param params [Hash] Hash of parameters for the API - see REST API docs
# @return [Hash] See Pusher API docs
# @raise [Pusher::Error] on invalid Pusher response - see the error message for more details
# @raise [Pusher::HTTPError] on any error raised inside Net::HTTP - the original error is available in the original_error attribute
#
- def channel_info(channel_name, options = {})
- get("/channels/#{channel_name}", options)
+ def channel_info(channel_name, params = {})
+ get("/channels/#{channel_name}", params)
end
# Trigger an event on one or more channels
@@ -155,20 +155,20 @@ def channel_info(channel_name, options = {})
# @param event_name [String]
# @param data [Object] Event data to be triggered in javascript.
# Objects other than strings will be converted to JSON
- # @param options [Hash] Additional options to send to api, e.g socket_id
+ # @param params [Hash] Additional parameters to send to api, e.g socket_id
# @return [Hash] See Pusher API docs
# @raise [Pusher::Error] on invalid Pusher response - see the error message for more details
# @raise [Pusher::HTTPError] on any error raised inside Net::HTTP - the original error is available in the original_error attribute
#
- def trigger(channels, event_name, data, options = {})
- post('/events', trigger_params(channels, event_name, data, options))
+ def trigger(channels, event_name, data, params = {})
+ post('/events', trigger_params(channels, event_name, data, params))
end
# Trigger an event on one or more channels asynchronously.
# For parameters see #trigger
#
- def trigger_async(channels, event_name, data, options = {})
- post_async('/events', trigger_params(channels, event_name, data, options))
+ def trigger_async(channels, event_name, data, params = {})
+ post_async('/events', trigger_params(channels, event_name, data, params))
end
# @private Construct a net/http http client
View
@@ -213,7 +213,7 @@
should == {}
end
- it "should pass any options in the body of the request" do
+ it "should pass any parameters in the body of the request" do
@client.trigger('mychannel', 'event', {'some' => 'data'}, {
:socket_id => "1234"
})

0 comments on commit fb52cfa

Please sign in to comment.