Class: BCDice::GameSystem::FilledWith::Difficulty
- Inherits:
-
Object
- Object
- BCDice::GameSystem::FilledWith::Difficulty
- Defined in:
- lib/bcdice/game_system/FilledWith.rb
Constant Summary collapse
- DIFFICULTYS =
["E", "N", "H", "L", "X"].freeze
- NAMES =
{ "E" => "初級", "N" => "中級", "H" => "上級", "L" => "悪夢", "X" => "伝説", }.freeze
Instance Method Summary collapse
- #index ⇒ Object
-
#initialize(sign) ⇒ Difficulty
constructor
A new instance of Difficulty.
- #name ⇒ Object
Constructor Details
#initialize(sign) ⇒ Difficulty
Returns a new instance of Difficulty.
237 238 239 |
# File 'lib/bcdice/game_system/FilledWith.rb', line 237 def initialize(sign) @sign = sign end |
Instance Method Details
#index ⇒ Object
241 242 243 |
# File 'lib/bcdice/game_system/FilledWith.rb', line 241 def index @index ||= DIFFICULTYS.find_index(@sign) end |
#name ⇒ Object
245 246 247 |
# File 'lib/bcdice/game_system/FilledWith.rb', line 245 def name @name ||= NAMES[@sign] end |