Class: Smite::GodRank
Instance Attribute Summary
Attributes inherited from Object
#data
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Object
#attributes, #method_missing
Constructor Details
#initialize(data) ⇒ GodRank
Returns a new instance of GodRank.
3
4
5
|
# File 'lib/smite/god_rank.rb', line 3
def initialize(data)
super(DataTransform.transform_gods(data))
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Smite::Object
Class Method Details
.level(rank) ⇒ Object
23
24
25
26
27
28
29
30
|
# File 'lib/smite/god_rank.rb', line 23
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
|
Instance Method Details
19
20
21
|
# File 'lib/smite/god_rank.rb', line 19
def inspect
"#<Smite::GodRank '#{god.name}' Lvl. #{rank} (#{level})>"
end
|
7
8
9
|
# File 'lib/smite/god_rank.rb', line 7
def level
self.class.level(rank)
end
|
#mastered? ⇒ Boolean
15
16
17
|
# File 'lib/smite/god_rank.rb', line 15
def mastered?
rank > 0
end
|
11
12
13
|
# File 'lib/smite/god_rank.rb', line 11
def mastery
mastered? ? 'mastered' : 'unmastered'
end
|