lib/smite/god_rank.rb in smite_ruby-1.4.5 vs lib/smite/god_rank.rb in smite_ruby-1.4.6

- old
+ new

@@ -3,26 +3,30 @@ def initialize(data) super(DataTransform.transform_gods(data)) end def level - case rank - when 0 then 'none' - when (1..4) then 'gold' - when (5..9) then 'legendary' - when 10 then 'diamond' - end + self.class.level(rank) end def mastery - mastered ? 'mastered' : 'unmastered' + mastered? ? 'mastered' : 'unmastered' end def mastered? rank > 0 end def inspect "#<Smite::GodRank '#{god.name}' Lvl. #{rank} (#{level})>" + end + + def self.level(rank) + case rank + when 0 then 'none' + when (1..4) then 'gold' + when (5..9) then 'legendary' + when 10 then 'diamond' + end end end end \ No newline at end of file