Class: BCDice::Preprocessor
- Inherits:
-
Object
- Object
- BCDice::Preprocessor
- Defined in:
- lib/bcdice/preprocessor.rb
Overview
入力文字列に対して前処理を行う
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(text, game_system) ⇒ Preprocessor
constructor
A new instance of Preprocessor.
- #process ⇒ String
Constructor Details
#initialize(text, game_system) ⇒ Preprocessor
Returns a new instance of Preprocessor.
20 21 22 23 |
# File 'lib/bcdice/preprocessor.rb', line 20 def initialize(text, game_system) @text = text @game_system = game_system end |
Class Method Details
.process(text, game_system) ⇒ String
14 15 16 |
# File 'lib/bcdice/preprocessor.rb', line 14 def self.process(text, game_system) Preprocessor.new(text, game_system).process() end |
Instance Method Details
#process ⇒ String
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/bcdice/preprocessor.rb', line 26 def process trim_after_whitespace() replace_parentheses() @text = @game_system.change_text(@text) replace_implicit_d() return @text end |