Class: BlizzardApi::Diablo::CharacterClass

Inherits:
Request show all
Defined in:
lib/blizzard_api/diablo/community/character_class.rb

Overview

This class allows access to Diablo III character data

You can get an instance of this class using the default region as follows:

api_instance = BlizzardApi::Diablo.character

Constant Summary

Constants inherited from Request

Request::CACHE_DAY, Request::CACHE_HOUR, Request::CACHE_TRIMESTER

Constants included from ApiStandards

ApiStandards::BASE_URLS

Instance Attribute Summary

Attributes inherited from Request

#mode, #region

Instance Method Summary collapse

Methods inherited from Request

#initialize

Methods inherited from Request

#initialize

Constructor Details

This class inherits a constructor from BlizzardApi::Diablo::Request

Instance Method Details

#get(class_slug, **options) ⇒ Hash

Return information about a class

in the configuration module

Parameters:

  • class_slug (String)

    Class slug

  • options (Hash)

    a customizable set of options

Options Hash (**options):

  • :completed (Boolean)

    Should return completed quests

Returns:

  • (Hash)

    API Response. The actual type of the returned object depends on the format option



20
21
22
# File 'lib/blizzard_api/diablo/community/character_class.rb', line 20

def get(class_slug, **options)
  api_request "#{base_url(:community)}/data/hero/#{class_slug}", **{ ttl: CACHE_TRIMESTER }.merge(options)
end

#skill(class_slug, skill_slug, **options) ⇒ Hash

Return information about a class’ skill

in the configuration module

Parameters:

  • class_slug (String)

    Class slug

  • skill_slug (String)

    Skill slug

  • options (Hash)

    a customizable set of options

Options Hash (**options):

  • :completed (Boolean)

    Should return completed quests

Returns:

  • (Hash)

    API Response. The actual type of the returned object depends on the format option



32
33
34
35
# File 'lib/blizzard_api/diablo/community/character_class.rb', line 32

def skill(class_slug, skill_slug, **options)
  opts = { ttl: CACHE_TRIMESTER }.merge(options)
  api_request "#{base_url(:community)}/data/hero/#{class_slug}/skill/#{skill_slug}", **opts
end