Class: GamyGame::HttpClient

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/gamygame/http_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_paramsObject (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, options = {})
  options.merge!(http_params)
  self.class.delete(path, options).parsed_response
end

#get(path, options = {}) ⇒ Object



15
16
17
18
# File 'lib/gamygame/http_client.rb', line 15

def get(path, options = {})
  options.merge!(http_params)
  self.class.get(path, options).parsed_response
end

#post(path, options = {}) ⇒ Object



20
21
22
23
# File 'lib/gamygame/http_client.rb', line 20

def post(path, options = {})
  options.merge!(http_params)
  self.class.post(path, options).parsed_response
end