Class: BCDice::GameSystem::SwordWorld::RatingParser
- Inherits:
- 
      Racc::Parser
      
        - Object
- Racc::Parser
- BCDice::GameSystem::SwordWorld::RatingParser
 
- Defined in:
- lib/bcdice/game_system/sword_world/rating_parser.rb
Overview
SwordWorldの威力表コマンドをパースするクラス
Instance Method Summary collapse
- 
  
    
      #initialize(version: :v1_0, round_type: RoundType::CEIL)  ⇒ RatingParser 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    デフォルトの丸めを切り上げとしているが、SwordWorldには切り捨てもあるので決め切れない(四捨五入は現状ない). 
- #parse(source) ⇒ BCDice::GameSystem::SwordWorld::RatingParsed?
- #set_debug ⇒ Object
Constructor Details
#initialize(version: :v1_0, round_type: RoundType::CEIL) ⇒ RatingParser
デフォルトの丸めを切り上げとしているが、SwordWorldには切り捨てもあるので決め切れない(四捨五入は現状ない)
| 25 26 27 28 29 | # File 'lib/bcdice/game_system/sword_world/rating_parser.rb', line 25 def initialize(version: :v1_0, round_type: RoundType::CEIL) super() @version = version @round_type = round_type end | 
Instance Method Details
#parse(source) ⇒ BCDice::GameSystem::SwordWorld::RatingParsed?
| 38 39 40 41 42 43 | # File 'lib/bcdice/game_system/sword_world/rating_parser.rb', line 38 def parse(source) @lexer = RatingLexer.new(source) do_parse() rescue ParseError, ZeroDivisionError nil end | 
#set_debug ⇒ Object
| 31 32 33 34 | # File 'lib/bcdice/game_system/sword_world/rating_parser.rb', line 31 def set_debug @yydebug = true return self end |