module GiantBombApi
Attributes
configuration[RW]
Public Class Methods
client()
click to toggle source
# File lib/giant_bomb_api.rb, line 31 def self.client raise_error "Configure GiantBombApi-module before using" if configuration.nil? raise_error "Configure 'api_key' first" if configuration.api_key.nil? @@client ||= GiantBombApi::Client.new(api_key: configuration.api_key) end
configure() { |configuration| ... }
click to toggle source
# File lib/giant_bomb_api.rb, line 20 def self.configure self.configuration ||= Configuration.new yield(configuration) @@client = nil end
raise_error(message)
click to toggle source
# File lib/giant_bomb_api.rb, line 16 def self.raise_error(message) raise Exception.new message end
search(query)
click to toggle source
# File lib/giant_bomb_api.rb, line 27 def self.search(query) client.send_request(Request::Search.new(query)) end