Class: Luchadeer::Client
- Inherits:
-
Object
- Object
- Luchadeer::Client
- Includes:
- API
- Defined in:
- lib/luchadeer/client.rb
Constant Summary collapse
- GIANT_BOMB =
'http://www.giantbomb.com/api'
Constants included from API
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
Attributes included from API
Instance Method Summary collapse
- #api_key? ⇒ Boolean
- #get(path, params = {}) ⇒ Object
-
#initialize(opts = {}) {|_self| ... } ⇒ Client
constructor
A new instance of Client.
- #user_agent ⇒ Object
Methods included from API
Constructor Details
#initialize(opts = {}) {|_self| ... } ⇒ Client
Returns a new instance of Client.
17 18 19 20 |
# File 'lib/luchadeer/client.rb', line 17 def initialize(opts = {}) @api_key = opts[:api_key] if opts[:api_key] yield self if block_given? end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
14 15 16 |
# File 'lib/luchadeer/client.rb', line 14 def api_key @api_key end |
Instance Method Details
#api_key? ⇒ Boolean
26 27 28 |
# File 'lib/luchadeer/client.rb', line 26 def api_key? not (api_key.nil? || api_key == '') end |
#get(path, params = {}) ⇒ Object
30 31 32 |
# File 'lib/luchadeer/client.rb', line 30 def get(path, params = {}) request(:get, path, params) end |