diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2015-11-09 17:35:41 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2015-11-09 17:35:41 +0900 |
commit | d2dcdf4f6ec478c139eb160e9c58dc95b96a3bbd (patch) | |
tree | e3213072c8395f917dbebb8874a468f00b39e241 /lib/plum | |
parent | 9bf2c8a0b1c1bf1010de5dea0c37627f7abd4944 (diff) | |
download | plum-d2dcdf4f6ec478c139eb160e9c58dc95b96a3bbd.tar.gz |
client: rename Client#[HTTP_METHOD]_async to #[HTTP_METHOD]
Diffstat (limited to 'lib/plum')
-rw-r--r-- | lib/plum/client.rb | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/lib/plum/client.rb b/lib/plum/client.rb index 233ad4b..cc255f4 100644 --- a/lib/plum/client.rb +++ b/lib/plum/client.rb @@ -83,49 +83,49 @@ module Plum @session.request(headers, body, options, &block) end - # @!method get - # @!method head - # @!method delete + # @!method get! + # @!method head! + # @!method delete! # @param path [String] the absolute path to request (translated into :path header) # @param options [Hash<Symbol, Object>] the request options # @param block [Proc] if specified, calls the block when finished - # Shorthand method for `#request` + # Shorthand method for `Client#resume(Client#request(*args))` - # @!method get_async - # @!method head_async - # @!method delete_async + # @!method get + # @!method head + # @!method delete # @param path [String] the absolute path to request (translated into :path header) # @param options [Hash<Symbol, Object>] the request options # @param block [Proc] if specified, calls the block when finished - # Shorthand method for `#request_async` + # Shorthand method for `#request` %w(GET HEAD DELETE).each { |method| - define_method(:"#{method.downcase}") do |path, options = {}, &block| + define_method(:"#{method.downcase}!") do |path, options = {}, &block| resume _request_helper(method, path, nil, options, &block) end - define_method(:"#{method.downcase}_async") do |path, options = {}, &block| + define_method(:"#{method.downcase}") do |path, options = {}, &block| _request_helper(method, path, nil, options, &block) end } - # @!method post - # @!method put + # @!method post! + # @!method put! # @param path [String] the absolute path to request (translated into :path header) # @param body [String] the request body # @param options [Hash<Symbol, Object>] the request options # @param block [Proc] if specified, calls the block when finished - # Shorthand method for `#request` + # Shorthand method for `Client#resume(Client#request(*args))` - # @!method post_async - # @!method put_async + # @!method post + # @!method put # @param path [String] the absolute path to request (translated into :path header) # @param body [String] the request body # @param options [Hash<Symbol, Object>] the request options # @param block [Proc] if specified, calls the block when finished - # Shorthand method for `#request_async` + # Shorthand method for `#request` %w(POST PUT).each { |method| - define_method(:"#{method.downcase}") do |path, body, options = {}, &block| + define_method(:"#{method.downcase}!") do |path, body, options = {}, &block| resume _request_helper(method, path, body, options, &block) end - define_method(:"#{method.downcase}_async") do |path, body, options = {}, &block| + define_method(:"#{method.downcase}") do |path, body, options = {}, &block| _request_helper(method, path, body, options, &block) end } |