Sha256: a5d0aa6e5db15a51036ce95ed7d5d480af2feaee6157b0eeed0d117538d5140d

Contents?: true

Size: 445 Bytes

Versions: 6

Compression:

Stored size: 445 Bytes

Contents

module Bnet
  class API
    # FIXME : get the API to append the :key param to the end of each 'get' call
    attr_accessor :region

    def initialize args
      args.each do |k,v|
        instance_variable_set("@#{k}", v) unless v.nil?
      end
    end

    def url
      "https://#{region}.api.battle.net/"
    end

    def self.valid_call?(status, response)
      status == ['200', 'OK'] && response["code"] != 'NOTFOUND'
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bnet-0.0.10 lib/bnet/api.rb
bnet-0.0.5 lib/bnet/api.rb
bnet-0.0.4 lib/bnet/api.rb
bnet-0.0.3 lib/bnet/api.rb
bnet-0.0.2 lib/bnet/api.rb
bnet-0.0.1 lib/bnet/api.rb