BnetApi
A Ruby wrapper for the Battle.net API.
Installation
gem install bnet_api
Requirements
- Ruby 2.0.0 or higher
Configuration
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
Regions
- us
- eu
- kr
- tw
Locales
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 |
Usage
Documentation can be found in the wiki