Class: Luchadeer::Client

Inherits:
Object
  • Object
show all
Includes:
API
Defined in:
lib/luchadeer/client.rb

Constant Summary collapse

GIANT_BOMB =
'http://www.giantbomb.com/api'

Constants included from API

API::RESOURCES

Instance Attribute Summary collapse

Attributes included from API

#cache

Instance Method Summary collapse

Methods included from API

#fetch

Constructor Details

#initialize(opts = {}) {|_self| ... } ⇒ Client

Returns a new instance of Client.

Yields:

  • (_self)

Yield Parameters:



18
19
20
21
# File 'lib/luchadeer/client.rb', line 18

def initialize(opts = {})
  @api_key = opts[:api_key] if opts[:api_key]
  yield self if block_given?
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



16
17
18
# File 'lib/luchadeer/client.rb', line 16

def api_key
  @api_key
end

Instance Method Details

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



23
24
25
# File 'lib/luchadeer/client.rb', line 23

def get(path, params = {})
  request(:get, path, params)
end