class OldSchool::HiScores::Skill
Attributes
@example
attack = OldSchool::HiScores::Skill.new :attack attack.name #=> "Attack"
@return [String] The name of this Skill
@return [Symbol] The of this Skill
Public Class Methods
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
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
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
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
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
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