Module: Lich::Gemstone::Experience
- Defined in:
- documented/gemstone/experience.rb
Overview
Provides methods to access experience-related data
Class Method Summary collapse
-
.axp ⇒ Integer
Retrieves the current ascension experience.
-
.deaths_sting ⇒ Integer
Retrieves the deaths sting value.
-
.deeds ⇒ Integer
Retrieves the number of deeds.
-
.exp ⇒ Integer
Retrieves the current experience.
-
.fame ⇒ Integer
Retrieves the current fame value.
-
.fxp_current ⇒ Integer
Retrieves the current field experience.
-
.fxp_max ⇒ Integer
Retrieves the maximum field experience.
-
.lte ⇒ Integer
Retrieves the long-term experience.
-
.percent_axp ⇒ Float
Calculates the percentage of ascension experience to total experience.
-
.percent_exp ⇒ Float
Calculates the percentage of current experience to total experience.
-
.percent_fxp ⇒ Float
Calculates the percentage of current field experience to maximum field experience.
-
.recently_updated?(threshold: 5.minutes) ⇒ Boolean
Checks if the experience data was recently updated based on a given threshold.
-
.stale?(threshold: 24.hours) ⇒ Boolean
Checks if the experience data is stale based on a given threshold.
-
.txp ⇒ Integer
Retrieves the total experience.
-
.updated_at ⇒ Time?
Retrieves the last updated timestamp for total experience.
Class Method Details
.axp ⇒ Integer
Retrieves the current ascension experience
48 49 50 |
# File 'documented/gemstone/experience.rb', line 48 def self.axp Infomon.get("experience.ascension_experience") end |
.deaths_sting ⇒ Integer
Retrieves the deaths sting value
104 105 106 |
# File 'documented/gemstone/experience.rb', line 104 def self.deaths_sting Infomon.get("experience.deaths_sting") end |
.deeds ⇒ Integer
Retrieves the number of deeds
96 97 98 |
# File 'documented/gemstone/experience.rb', line 96 def self.deeds Infomon.get("experience.deeds") end |
.exp ⇒ Integer
Retrieves the current experience
40 41 42 |
# File 'documented/gemstone/experience.rb', line 40 def self.exp Stats.exp end |
.fame ⇒ Integer
Retrieves the current fame value
16 17 18 |
# File 'documented/gemstone/experience.rb', line 16 def self.fame Infomon.get("experience.fame") end |
.fxp_current ⇒ Integer
Retrieves the current field experience
24 25 26 |
# File 'documented/gemstone/experience.rb', line 24 def self.fxp_current Infomon.get("experience.field_experience_current") end |
.fxp_max ⇒ Integer
Retrieves the maximum field experience
32 33 34 |
# File 'documented/gemstone/experience.rb', line 32 def self.fxp_max Infomon.get("experience.field_experience_max") end |
.lte ⇒ Integer
Retrieves the long-term experience
88 89 90 |
# File 'documented/gemstone/experience.rb', line 88 def self.lte Infomon.get("experience.long_term_experience") end |
.percent_axp ⇒ Float
Calculates the percentage of ascension experience to total experience
72 73 74 |
# File 'documented/gemstone/experience.rb', line 72 def self.percent_axp (axp.to_f / txp.to_f) * 100 end |
.percent_exp ⇒ Float
Calculates the percentage of current experience to total experience
80 81 82 |
# File 'documented/gemstone/experience.rb', line 80 def self.percent_exp (exp.to_f / txp.to_f) * 100 end |
.percent_fxp ⇒ Float
Calculates the percentage of current field experience to maximum field experience
64 65 66 |
# File 'documented/gemstone/experience.rb', line 64 def self.percent_fxp (fxp_current.to_f / fxp_max.to_f) * 100 end |
.recently_updated?(threshold: 5.minutes) ⇒ Boolean
Checks if the experience data was recently updated based on a given threshold
132 133 134 135 |
# File 'documented/gemstone/experience.rb', line 132 def self.recently_updated?(threshold: 5.minutes) return false unless updated_at updated_at >= threshold.ago end |
.stale?(threshold: 24.hours) ⇒ Boolean
Checks if the experience data is stale based on a given threshold
122 123 124 125 |
# File 'documented/gemstone/experience.rb', line 122 def self.stale?(threshold: 24.hours) return true unless updated_at updated_at < threshold.ago end |
.txp ⇒ Integer
Retrieves the total experience
56 57 58 |
# File 'documented/gemstone/experience.rb', line 56 def self.txp Infomon.get("experience.total_experience") end |
.updated_at ⇒ Time?
Retrieves the last updated timestamp for total experience
112 113 114 115 |
# File 'documented/gemstone/experience.rb', line 112 def self.updated_at = Infomon.get_updated_at("experience.total_experience") ? Time.at() : nil end |