Class: MaimaiNet::Constants::Difficulty
- Inherits:
-
Object
- Object
- MaimaiNet::Constants::Difficulty
- Includes:
- ModuleExt
- Defined in:
- lib/maimai_net/constants.rb
Constant Summary collapse
- ORIGINAL =
{ all: 0, easy: 1, basic: 2, advanced: 3, expert: 4, master: 5, remaster: 6, utage: 10, }
- DELUXE =
{ all: 0, basic: 1, advanced: 2, expert: 3, master: 4, remaster: 5, utage: 10, }
- DELUXE_WEBSITE =
{ all: 99, basic: 0, advanced: 1, expert: 2, master: 3, remaster: 4, utage: 10, }
- LIBRARY =
{ all: 0, easy: 1, basic: 2, advanced: 3, expert: 4, master: 5, remaster: 6, utage: 10, }
- SHORTS =
{ easy: :EM, basic: :BS, advanced: :AD, expert: :EX, master: :MS, remaster: :RMS, }
Instance Attribute Summary collapse
-
#abbrev ⇒ Object
readonly
Returns the value of attribute abbrev.
-
#deluxe_id ⇒ Object
readonly
Returns the value of attribute deluxe_id.
-
#deluxe_web_id ⇒ Object
readonly
Returns the value of attribute deluxe_web_id.
-
#id ⇒ Object
(also: #to_i)
readonly
Returns the value of attribute id.
-
#key ⇒ Object
(also: #long, #to_sym)
readonly
Returns the value of attribute key.
-
#original_id ⇒ Object
readonly
Returns the value of attribute original_id.
Instance Method Summary collapse
-
#initialize(key) ⇒ Difficulty
constructor
A new instance of Difficulty.
Constructor Details
#initialize(key) ⇒ Difficulty
Returns a new instance of Difficulty.
253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/maimai_net/constants.rb', line 253 def initialize(key) @key = key @id = LIBRARY[key] @original_id = ORIGINAL[key] @deluxe_id = DELUXE[key] @deluxe_web_id = DELUXE_WEBSITE[key] @abbrev = SHORTS.fetch(key, key.upcase) freeze end |
Instance Attribute Details
#abbrev ⇒ Object (readonly)
Returns the value of attribute abbrev.
266 267 268 |
# File 'lib/maimai_net/constants.rb', line 266 def abbrev @abbrev end |
#deluxe_id ⇒ Object (readonly)
Returns the value of attribute deluxe_id.
267 268 269 |
# File 'lib/maimai_net/constants.rb', line 267 def deluxe_id @deluxe_id end |
#deluxe_web_id ⇒ Object (readonly)
Returns the value of attribute deluxe_web_id.
267 268 269 |
# File 'lib/maimai_net/constants.rb', line 267 def deluxe_web_id @deluxe_web_id end |
#id ⇒ Object (readonly) Also known as: to_i
Returns the value of attribute id.
267 268 269 |
# File 'lib/maimai_net/constants.rb', line 267 def id @id end |
#key ⇒ Object (readonly) Also known as: long, to_sym
Returns the value of attribute key.
266 267 268 |
# File 'lib/maimai_net/constants.rb', line 266 def key @key end |
#original_id ⇒ Object (readonly)
Returns the value of attribute original_id.
267 268 269 |
# File 'lib/maimai_net/constants.rb', line 267 def original_id @original_id end |