Class: GamyGame::HttpClient
- Inherits:
-
Object
- Object
- GamyGame::HttpClient
- Includes:
- HTTParty
- Defined in:
- lib/gamygame/http_client.rb
Instance Attribute Summary collapse
-
#http_params ⇒ Object
readonly
Returns the value of attribute http_params.
Instance Method Summary collapse
- #delete(path, options = {}) ⇒ Object
- #get(path, options = {}) ⇒ Object
-
#initialize(http_params = {}) ⇒ HttpClient
constructor
A new instance of HttpClient.
- #post(path, options = {}) ⇒ Object
Constructor Details
#initialize(http_params = {}) ⇒ HttpClient
11 12 13 |
# File 'lib/gamygame/http_client.rb', line 11 def initialize(http_params = {}) @http_params = http_params end |
Instance Attribute Details
#http_params ⇒ Object (readonly)
Returns the value of attribute http_params.
9 10 11 |
# File 'lib/gamygame/http_client.rb', line 9 def http_params @http_params end |
Instance Method Details
#delete(path, options = {}) ⇒ Object
25 26 27 28 |
# File 'lib/gamygame/http_client.rb', line 25 def delete(path, = {}) .merge!(http_params) self.class.delete(path, ).parsed_response end |
#get(path, options = {}) ⇒ Object
15 16 17 18 |
# File 'lib/gamygame/http_client.rb', line 15 def get(path, = {}) .merge!(http_params) self.class.get(path, ).parsed_response end |
#post(path, options = {}) ⇒ Object
20 21 22 23 |
# File 'lib/gamygame/http_client.rb', line 20 def post(path, = {}) .merge!(http_params) self.class.post(path, ).parsed_response end |