Class: BlizzardApi::Wow::Journal

Inherits:
GenericDataEndpoint show all
Defined in:
lib/blizzard_api/wow/game_data/journal.rb

Overview

This class allows access to World of Warcraft journal data

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

api_instance = BlizzardApi::Wow.journal

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 GenericDataEndpoint

setup

Methods inherited from Request

#initialize

Methods inherited from Request

#initialize

Constructor Details

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

Instance Method Details

#encounter(id, **options) ⇒ Hash

Return data about an encounter journal entry

in the configuration module

Parameters:

  • id (Integer)

    Journal entry id

  • options (Hash)

    You can specify some options

Options Hash (**options):

  • :locale (String)

    Overrides the default locale for a single call

  • :namespace (String)

    Overrides the default namespace for a single call

  • :access_token (String)

    Overrides the access_token for a single call

  • :ignore_cache (Boolean)

    If set to true the request will not use the cache

  • :ttl (Integer)

    Override the default time (in seconds) a request should be cached

  • :since (DateTime)

    Adds the If-modified-since headers. Will always ignore cache when set.

Returns:

  • (Hash)

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



90
91
92
# File 'lib/blizzard_api/wow/game_data/journal.rb', line 90

def encounter(id, **options)
  api_request "#{endpoint_uri('encounter')}/#{id}", **default_options.merge(options)
end

#encounter_search(page = 1, page_size = 100, **options) {|search_options| ... } ⇒ Hash

Fetch data base on search criteria

in the configuration module

Parameters:

  • page (Integer) (defaults to: 1)

    Page o return

  • page_size (Integer) (defaults to: 100)

    Amount of items per page

  • options (Hash)

    You can specify some options

Options Hash (**options):

  • :locale (String)

    Overrides the default locale for a single call

  • :namespace (String)

    Overrides the default namespace for a single call

  • :access_token (String)

    Overrides the access_token for a single call

  • :ignore_cache (Boolean)

    If set to true the request will not use the cache

  • :ttl (Integer)

    Override the default time (in seconds) a request should be cached

  • :since (DateTime)

    Adds the If-modified-since headers. Will always ignore cache when set.

Yields:

  • (search_options)

Returns:

  • (Hash)

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



102
103
104
105
106
107
# File 'lib/blizzard_api/wow/game_data/journal.rb', line 102

def encounter_search(page = 1, page_size = 100, **options)
  search_options = SearchComposer.new(page, page_size)
  yield search_options if block_given?

  api_request "#{endpoint_uri('encounter', :search)}?#{search_options.to_search_query}", **default_options.merge(options)
end

#encounters(**options) ⇒ Hash

Return a list of encounter journal entries

in the configuration module

Parameters:

  • options (Hash)

    You can specify some options

Options Hash (**options):

  • :locale (String)

    Overrides the default locale for a single call

  • :namespace (String)

    Overrides the default namespace for a single call

  • :access_token (String)

    Overrides the access_token for a single call

  • :ignore_cache (Boolean)

    If set to true the request will not use the cache

  • :ttl (Integer)

    Override the default time (in seconds) a request should be cached

  • :since (DateTime)

    Adds the If-modified-since headers. Will always ignore cache when set.

Returns:

  • (Hash)

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



79
80
81
# File 'lib/blizzard_api/wow/game_data/journal.rb', line 79

def encounters(**options)
  api_request "#{endpoint_uri('encounter')}/index", **default_options.merge(options)
end

#expansion(id, **options) ⇒ Hash

Return data about an expansion journal entry

in the configuration module

Parameters:

  • id (Integer)

    Journal entry id

  • options (Hash)

    You can specify some options

Options Hash (**options):

  • :locale (String)

    Overrides the default locale for a single call

  • :namespace (String)

    Overrides the default namespace for a single call

  • :access_token (String)

    Overrides the access_token for a single call

  • :ignore_cache (Boolean)

    If set to true the request will not use the cache

  • :ttl (Integer)

    Override the default time (in seconds) a request should be cached

  • :since (DateTime)

    Adds the If-modified-since headers. Will always ignore cache when set.

Returns:

  • (Hash)

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



48
49
50
# File 'lib/blizzard_api/wow/game_data/journal.rb', line 48

def expansion(id, **options)
  api_request "#{endpoint_uri('expansion')}/#{id}", **default_options.merge(options)
end

#expansions(**options) ⇒ Hash

Return a list of expansion journal entries

in the configuration module

Parameters:

  • options (Hash)

    You can specify some options

Options Hash (**options):

  • :locale (String)

    Overrides the default locale for a single call

  • :namespace (String)

    Overrides the default namespace for a single call

  • :access_token (String)

    Overrides the access_token for a single call

  • :ignore_cache (Boolean)

    If set to true the request will not use the cache

  • :ttl (Integer)

    Override the default time (in seconds) a request should be cached

  • :since (DateTime)

    Adds the If-modified-since headers. Will always ignore cache when set.

Returns:

  • (Hash)

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



37
38
39
# File 'lib/blizzard_api/wow/game_data/journal.rb', line 37

def expansions(**options)
  api_request "#{endpoint_uri('expansion')}/index", **default_options.merge(options)
end

#get(_id) ⇒ Hash

This method overrides the inherited default behavior to prevent high server load and fetch time

in the configuration module

Returns:

  • (Hash)

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

Raises:



27
28
29
# File 'lib/blizzard_api/wow/game_data/journal.rb', line 27

def get(_id)
  raise BlizzardApi::ApiException, 'This endpoint does not have a get method'
end

#indexHash

This method overrides the inherited default behavior to prevent high server load and fetch time

in the configuration module

Returns:

  • (Hash)

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

Raises:



19
20
21
# File 'lib/blizzard_api/wow/game_data/journal.rb', line 19

def index
  raise BlizzardApi::ApiException, 'This endpoint does not have a index method'
end

#instance(id, **options) ⇒ Hash

Return data about an instance journal entry

in the configuration module

Parameters:

  • id (Integer)

    Journal entry id

  • options (Hash)

    You can specify some options

Options Hash (**options):

  • :locale (String)

    Overrides the default locale for a single call

  • :namespace (String)

    Overrides the default namespace for a single call

  • :access_token (String)

    Overrides the access_token for a single call

  • :ignore_cache (Boolean)

    If set to true the request will not use the cache

  • :ttl (Integer)

    Override the default time (in seconds) a request should be cached

  • :since (DateTime)

    Adds the If-modified-since headers. Will always ignore cache when set.

Returns:

  • (Hash)

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



69
70
71
# File 'lib/blizzard_api/wow/game_data/journal.rb', line 69

def instance(id, **options)
  api_request "#{endpoint_uri('instance')}/#{id}", **default_options.merge(options)
end

#instances(**options) ⇒ Hash

Return a list of instance journal entries

in the configuration module

Parameters:

  • options (Hash)

    You can specify some options

Options Hash (**options):

  • :locale (String)

    Overrides the default locale for a single call

  • :namespace (String)

    Overrides the default namespace for a single call

  • :access_token (String)

    Overrides the access_token for a single call

  • :ignore_cache (Boolean)

    If set to true the request will not use the cache

  • :ttl (Integer)

    Override the default time (in seconds) a request should be cached

  • :since (DateTime)

    Adds the If-modified-since headers. Will always ignore cache when set.

Returns:

  • (Hash)

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



58
59
60
# File 'lib/blizzard_api/wow/game_data/journal.rb', line 58

def instances(**options)
  api_request "#{endpoint_uri('instance')}/index", **default_options.merge(options)
end