Class: Elvarg::Stats::Skill
- Inherits:
-
Object
- Object
- Elvarg::Stats::Skill
- Defined in:
- lib/stats/skill.rb
Overview
Represents a Skill in OldSchool RuneScape
Direct Known Subclasses
Instance Attribute Summary collapse
-
#icon ⇒ Object
readonly
The link to the ‘.gif` of the related Skill.
-
#id ⇒ Object
readonly
The unique id of this Skill.
-
#name ⇒ Object
readonly
The human readable name of this Skill.
-
#symbol ⇒ Object
readonly
The symbol of this Skill.
Instance Method Summary collapse
-
#combat? ⇒ true, false
Determines if this Skill will affect a player’s combat.
-
#free? ⇒ Boolean
Determines if this Skill is a free-to-play skill.
-
#initialize(symbol, id = 0) ⇒ Skill
constructor
Creates a new Skill object.
-
#member? ⇒ true, false
Determines if this Skill is a member’s only skill.
-
#skiller_friendly? ⇒ Boolean
Determines if this Skill does not affect a player’s combat.
Constructor Details
#initialize(symbol, id = 0) ⇒ Skill
Creates a new Skill object.
36 37 38 39 40 41 42 |
# File 'lib/stats/skill.rb', line 36 def initialize(symbol, id = 0) @id = id @symbol = symbol @name = symbol.to_s.capitalize @icon = 'https://www.runescape.com/img/rsp777/' \ "hiscores/skill_icon_#{@name.downcase}1.gif" end |
Instance Attribute Details
#icon ⇒ Object (readonly)
The link to the ‘.gif` of the related Skill
9 10 11 |
# File 'lib/stats/skill.rb', line 9 def icon @icon end |
#id ⇒ Object (readonly)
The unique id of this Skill
11 12 13 |
# File 'lib/stats/skill.rb', line 11 def id @id end |
#name ⇒ Object (readonly)
The human readable name of this Skill
13 14 15 |
# File 'lib/stats/skill.rb', line 13 def name @name end |
#symbol ⇒ Object (readonly)
The symbol of this Skill
17 18 19 |
# File 'lib/stats/skill.rb', line 17 def symbol @symbol end |
Instance Method Details
#combat? ⇒ true, false
Determines if this Skill will affect a player’s combat
76 77 78 |
# File 'lib/stats/skill.rb', line 76 def combat? COMBAT_SKILLS.include? @symbol end |
#free? ⇒ Boolean
This is the inverse of #member?
Determines if this Skill is a free-to-play skill.
62 63 64 |
# File 'lib/stats/skill.rb', line 62 def free? !member? end |
#member? ⇒ true, false
Determines if this Skill is a member’s only skill.
53 54 55 |
# File 'lib/stats/skill.rb', line 53 def member? MEMBER_SKILLS.include? @symbol end |
#skiller_friendly? ⇒ Boolean
This is the inverse of ‘combat?`
Determines if this Skill does not affect a player’s combat
85 86 87 |
# File 'lib/stats/skill.rb', line 85 def skiller_friendly? !combat? end |