Class: SportsApi::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/sports_api/resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Resource

Returns a new instance of Resource.



7
8
9
# File 'lib/sports_api/resource.rb', line 7

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



5
6
7
# File 'lib/sports_api/resource.rb', line 5

def client
  @client
end

Instance Method Details

#get_request(path, params: {}, headers: {}) ⇒ Object



11
12
13
# File 'lib/sports_api/resource.rb', line 11

def get_request(path, params: {}, headers: {})
  handle_response(client.connection.get(path, params, default_headers.merge(headers)))
end