Class: BCDice::GameSystem::FilledWith::Difficulty

Inherits:
Object
  • Object
show all
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

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

#indexObject



241
242
243
# File 'lib/bcdice/game_system/FilledWith.rb', line 241

def index
  @index ||= DIFFICULTYS.find_index(@sign)
end

#nameObject



245
246
247
# File 'lib/bcdice/game_system/FilledWith.rb', line 245

def name
  @name ||= NAMES[@sign]
end