Class: BCDice::Arithmetic::Node::Parenthesis

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

Overview

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

Instance Method Summary collapse

Constructor Details

#initialize(expr) ⇒ Parenthesis



184
185
186
# File 'lib/bcdice/arithmetic/node.rb', line 184

def initialize(expr)
  @expr = expr
end

Instance Method Details

#eval(round_type) ⇒ Integer



190
191
192
# File 'lib/bcdice/arithmetic/node.rb', line 190

def eval(round_type)
  @expr.eval(round_type)
end

#outputString



195
196
197
# File 'lib/bcdice/arithmetic/node.rb', line 195

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

#s_expString



200
201
202
# File 'lib/bcdice/arithmetic/node.rb', line 200

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