class BCDice::Arithmetic::Node::Negative

Public Class Methods

new(body) click to toggle source
# File lib/bcdice/arithmetic/node.rb, line 163
def initialize(body)
  @body = body
end

Public Instance Methods

eval(round_type) click to toggle source
# File lib/bcdice/arithmetic/node.rb, line 167
def eval(round_type)
  -@body.eval(round_type)
end
output() click to toggle source

@return [String] メッセージへの出力

# File lib/bcdice/arithmetic/node.rb, line 172
def output
  "-#{@body.output}"
end
s_exp() click to toggle source
# File lib/bcdice/arithmetic/node.rb, line 176
def s_exp
  "(- #{@body.s_exp})"
end