module Destiny::Advisors

Public Instance Methods

arena(level=32) click to toggle source

GET the weekly prison of elders pulled info from ‘/advisors’ endpoint Without any arguments, only returns the level 32 information.

Usage:

client.arena(34)

Arguments:

level: (integer)
# File lib/destiny_rb/advisors.rb, line 104
def arena(level=32)
  arenas = self.daily_report['arena']
  case level
   when 32
     arenas[0]
   when 34
     arenas[1]
   when 35
     arenas[2]
  end
end
daily_report() click to toggle source

GET the days advisor report from www.bungie.net/platform/destiny/advisors/

Usage:

Destiny::Advisors.report

Returns:

A JSON object containing activity hashes, end times, and special events.
# File lib/destiny_rb/advisors.rb, line 12
def daily_report
  raw_data = self.class.get('/Advisors', headers: @headers)
  parsed = raw_data.parsed_response['Response']['data']
end
nightfall(raw=false) click to toggle source

GET the weekly nightfall info from ‘/manifest/activity/#{activity_hash}’

Optional boolean argument.

Usage:

client.nightfall(true)

Arguments:

raw: (boolean)
# File lib/destiny_rb/advisors.rb, line 59
def nightfall(raw=false)
  nightfall_info = self.daily_report["nightfall"]

  nightfall_activity_hash = nightfall_info["activityBundleHash"]
  activity_info = activity_search(nightfall_activity_hash, raw)

  if raw
    activity_info
  else
    active_skulls = nightfall_info["tiers"][0]["skullIndexes"]
    all_skulls = activity_info[:skulls]

    activity_info[:activeSkulls] = active_skulls.map { |index| all_skulls[index] }

    specific_activity = activity_search(nightfall_info["tiers"][0]["specificActivityHash"])
    activity_info[:specificActivity] = specific_activity
    activity_info
  end
end
weekly_strike(raw=false) click to toggle source

GET the weekly strike info from ‘/manifest/activity/#{activity_hash}’ Returns an array of three items, only need one for the skulls and location.

Optional boolean argument, defaults to false from activity method to return basic information for Lita bot.

Usage:

client.weekly_strike(false)

Arguments:

raw: (boolean)
# File lib/destiny_rb/advisors.rb, line 90
def weekly_strike(raw=false)
  heroic_strike_hashes = self.daily_report['heroicStrikeHashes']
  activity_search(heroic_strike_hashes[0], raw)
end