Class: StormgateWorld::Leaderboard
- Inherits:
-
Object
- Object
- StormgateWorld::Leaderboard
- Defined in:
- lib/stormgate_world/models/leaderboard.rb
Constant Summary collapse
- RANKED_1V1 =
"ranked_1v1".freeze
- UNRANKED_1V1 =
"unranked_1v1".freeze
- CUSTOM =
"custom".freeze
Class Method Summary collapse
- .all_vars ⇒ Object
-
.build_from_hash(value) ⇒ String
Builds the enum from string.
Instance Method Summary collapse
-
#build_from_hash(value) ⇒ String
Builds the enum from string.
Class Method Details
.all_vars ⇒ Object
22 23 24 |
# File 'lib/stormgate_world/models/leaderboard.rb', line 22 def self.all_vars @all_vars ||= [RANKED_1V1, UNRANKED_1V1, CUSTOM].freeze end |
.build_from_hash(value) ⇒ String
Builds the enum from string
29 30 31 |
# File 'lib/stormgate_world/models/leaderboard.rb', line 29 def self.build_from_hash(value) new.build_from_hash(value) end |
Instance Method Details
#build_from_hash(value) ⇒ String
Builds the enum from string
36 37 38 39 |
# File 'lib/stormgate_world/models/leaderboard.rb', line 36 def build_from_hash(value) return value if Leaderboard.all_vars.include?(value) raise "Invalid ENUM value #{value} for class #Leaderboard" end |