@@ -144,7 +144,7 @@ def resource(path)
144
144
# @raise [Pusher::HTTPError] Error raised inside http client. The original error is wrapped in error.original_error
145
145
#
146
146
def get ( path , params = { } )
147
- Resource . new ( self , path ) . get ( params )
147
+ resource ( path ) . get ( params )
148
148
end
149
149
150
150
# GET arbitrary REST API resource using an asynchronous http client.
@@ -160,20 +160,20 @@ def get(path, params = {})
160
160
# @return Either an EM::DefaultDeferrable or a HTTPClient::Connection
161
161
#
162
162
def get_async ( path , params = { } )
163
- Resource . new ( self , path ) . get_async ( params )
163
+ resource ( path ) . get_async ( params )
164
164
end
165
165
166
166
# POST arbitrary REST API resource using a synchronous http client.
167
167
# Works identially to get method, but posts params as JSON in post body.
168
168
def post ( path , params = { } )
169
- Resource . new ( self , path ) . post ( params )
169
+ resource ( path ) . post ( params )
170
170
end
171
171
172
172
# POST arbitrary REST API resource using an asynchronous http client.
173
173
# Works identially to get_async method, but posts params as JSON in post
174
174
# body.
175
175
def post_async ( path , params = { } )
176
- Resource . new ( self , path ) . post_async ( params )
176
+ resource ( path ) . post_async ( params )
177
177
end
178
178
179
179
## HELPER METHODS ##
0 commit comments