A Ruby wrapper for the Battle.net API.
gem install bnet_api
- Ruby 2.0.0 or higher
You need to set at least the Battle.net API key in the configuration, either in the code or in an initializer.
You can also change the region of the API to query and the locale of the returned data.
BnetApi.config.api_key = 'YOUR_API_KEY'
BnetApi.config.api_secret = 'YOUR_API_SECRET'
# config/initializers/bnet_api.rb
require 'bnet_api'
BnetApi.configure do |config|
config.region = :eu
config.locale = :en_GB
config.api_key = 'YOUR_API_KEY'
config.api_secret = 'YOUR_API_SECRET'
end
- us
- eu
- kr
- tw
Region | Locales |
---|---|
us | en_US, es_MX, pt_BR |
eu | en_GB, es_ES, fr_FR, ru_RU, de_DE, pl_PL, pt_PT, it_IT |
kr | ko_KR |
tw | zh_TW |
Documentation can be found in the wiki