Class: RsApi::MonthlyXp

Inherits:
Runemetrics show all
Defined in:
lib/rs_api/runemetrics/monthly_xp.rb

Overview

For obtaining monthly xp data for a user.

Defined Under Namespace

Classes: MissingPlayerData

Constant Summary

Constants included from SkillHelper

SkillHelper::MAX, SkillHelper::MONTHLY_XP_SKILL_ID_CONST, SkillHelper::SKILL_ID_CONST

Instance Attribute Summary

Attributes inherited from Runemetrics

#player

Instance Method Summary collapse

Methods inherited from Runemetrics

#initialize

Methods included from PlayerNameHelper

check_player_name

Constructor Details

This class inherits a constructor from RsApi::Runemetrics

Instance Method Details

#previous_monthly_xp_dataObject

def display; end



16
17
18
19
20
# File 'lib/rs_api/runemetrics/monthly_xp.rb', line 16

def previous_monthly_xp_data
  # # Last entry is this current month
  # # Therefore, previous month is second to last entry
  raw_data.map { |data| data.last['monthData'][-2] }
end

#raw_dataObject



22
23
24
25
# File 'lib/rs_api/runemetrics/monthly_xp.rb', line 22

def raw_data
  # Data is a hash of the last 12 months of data for each key skill_name
  @raw_data ||= request_all_data
end