Class: BCDice::CommonCommand::AddDice::Node::Parenthesis

Inherits:
Object
  • Object
show all
Defined in:
lib/bcdice/common_command/add_dice/node.rb

Overview

カッコで式をまとめるノード

Instance Method Summary collapse

Constructor Details

#initialize(expr) ⇒ Parenthesis



586
587
588
# File 'lib/bcdice/common_command/add_dice/node.rb', line 586

def initialize(expr)
  @expr = expr
end

Instance Method Details

#eval(game_system, randomizer) ⇒ integer



592
593
594
# File 'lib/bcdice/common_command/add_dice/node.rb', line 592

def eval(game_system, randomizer)
  @expr.eval(game_system, randomizer)
end

#expr(game_system) ⇒ String



602
603
604
# File 'lib/bcdice/common_command/add_dice/node.rb', line 602

def expr(game_system)
  "(#{@expr.expr(game_system)})"
end

#include_dice?Boolean



597
598
599
# File 'lib/bcdice/common_command/add_dice/node.rb', line 597

def include_dice?
  @expr.include_dice?
end

#outputString



607
608
609
# File 'lib/bcdice/common_command/add_dice/node.rb', line 607

def output
  "(#{@expr.output})"
end

#s_expString



612
613
614
# File 'lib/bcdice/common_command/add_dice/node.rb', line 612

def s_exp
  "(Parenthesis #{@expr.s_exp})"
end