Class: DianPing::Client
- Inherits:
-
Object
- Object
- DianPing::Client
- Includes:
- API::Business
- Defined in:
- lib/dianping/client.rb
Instance Method Summary collapse
-
#delete(path, params = {}) ⇒ Object
Perform an HTTP DELETE request.
-
#get(path, params = {}) ⇒ Object
Perform an HTTP GET request.
-
#initialize(options = {}) ⇒ DianPing::Client
constructor
Initializes a new Client object.
-
#post(path, params = {}) ⇒ Object
Perform an HTTP POST request.
-
#put(path, params = {}) ⇒ Object
Perform an HTTP PUT request.
Methods included from API::Business
Methods included from API::Utils
Methods included from API::Auth
Constructor Details
#initialize(options = {}) ⇒ DianPing::Client
Initializes a new Client object
11 12 |
# File 'lib/dianping/client.rb', line 11 def initialize(={}) end |
Instance Method Details
#delete(path, params = {}) ⇒ Object
Perform an HTTP DELETE request
15 16 17 |
# File 'lib/dianping/client.rb', line 15 def delete(path, params={}) request(:delete, path, params) end |
#get(path, params = {}) ⇒ Object
Perform an HTTP GET request
20 21 22 |
# File 'lib/dianping/client.rb', line 20 def get(path, params={}) request(:get, path, params) end |
#post(path, params = {}) ⇒ Object
Perform an HTTP POST request
25 26 27 28 |
# File 'lib/dianping/client.rb', line 25 def post(path, params={}) signature_params = params.values.any?{|value| value.respond_to?(:to_io)} ? {} : params request(:post, path, params, signature_params) end |
#put(path, params = {}) ⇒ Object
Perform an HTTP PUT request
31 32 33 |
# File 'lib/dianping/client.rb', line 31 def put(path, params={}) request(:put, path, params) end |