class OldSchool::HiScores::Skill

Represents a Skill in OldSchool Runescape

Attributes

experience[R]

@return [Number] The experience of this Skill on the HiScores

level[R]

@return [Number] The level of this Skill on the HiScores

name[R]

@example

attack = OldSchool::HiScores::Skill.new :attack
attack.name #=> "Attack"

@return [String] The name of this Skill

rank[R]

@return [Number] The rank of this Skill on the HiScores

symbol[R]

@return [Symbol] The of this Skill

Public Class Methods

new(symbol, rank = 0, level = 1, experience = 0) click to toggle source

Creates a new instance of a Skill

@param symbol [Symbol] the Symbol of this Skill @param rank [Number] the rank on the HiScores in this Skill @param level [Number] the level in this Skill @param experience [Number] the total number of experience in this Skill

# File lib/oldschool/hiscores/skill.rb, line 30
def initialize(symbol, rank = 0, level = 1, experience = 0)
  @symbol = symbol
  @name = HiScores.human_name_for symbol
  @rank = rank
  @level = level
  @experience = experience
end

Public Instance Methods

combat?() click to toggle source

Determines if this Skill affects a Player's combat level

@example Attack affects combat level

skill = OldSchool::HiScores::Skill.new :attack
skill.combat? #=> true

@example Farming doesn't affect combat level

skill = OldSchool::HiScores::Skill.new :farming
skill.combat? #=> false

@see noncombat?

@return [true] if this skill affects a player's combat level @return [false] if this skill does not affect a player's combat level

# File lib/oldschool/hiscores/skill.rb, line 52
def combat?
  HiScores::COMBAT_SKILLS.include? @symbol
end
free?() click to toggle source

Determines if this is a free to play skill

@example Woodcutting is a free to play skill

skill = OldSchool::HiScores::Skill.new :woodcutting
skill.free? #=> true

@example Slayer is a member's only skill

skill = OldSchool::HiScores::Skill.new :slayer
skill.free? #=> false

@return [true] if this skill is free to play @return [false] if this skill is member's only

# File lib/oldschool/hiscores/skill.rb, line 114
def free?
  !member?
end
member?() click to toggle source

Determines if this is a member's only skill

@example Slayer is a member's only skill

skill = OldSchool::HiScores::Skill.new :slayer
skill.member? #=> true

@example Woodcutting is a free to play skill

skill = OldSchool::HiScores::Skill.new :woodcutting
skill.member? #=> false

@return [true] if this is a member's only skill @return [false] if this is free to play

# File lib/oldschool/hiscores/skill.rb, line 98
def member?
  HiScores::MEMBER_SKILLS.include? @symbol
end
noncombat?() click to toggle source

Determines if this Skill will not affect a Player's combat level

@example Farming doesn't affect combat level

skill = OldSchool::HiScores::Skill.new :farming
skill.noncombat? #=> true

@example Attack affects combat level

skill = OldSchool::HiScores::Skill.new :attack
skill.noncombat? #=> false

@note This is the inverse of combat? @see combat? @see skiller_friendly?

@return [true] if this skill does not affect a Player's combat level @return [false] if this skill affects a Player's combat level

# File lib/oldschool/hiscores/skill.rb, line 72
def noncombat?
  !combat?
end
nonmember?() click to toggle source

Determines if this is a free to play skill

@note This is an alias for free? @see free? @see member?

# File lib/oldschool/hiscores/skill.rb, line 124
def nonmember?
  free?
end
skiller_friendly?() click to toggle source

Determines if this Skill will not affect a Player's combat level

@note This is an alias for noncombat? @see noncombat? @see combat?

# File lib/oldschool/hiscores/skill.rb, line 82
def skiller_friendly?
  noncombat?
end