Class: BCDice::Arithmetic::Node::Negative
- Inherits:
-
Object
- Object
- BCDice::Arithmetic::Node::Negative
- Defined in:
- lib/bcdice/arithmetic/node.rb
Instance Method Summary collapse
- #eval(round_type) ⇒ Object
-
#initialize(body) ⇒ Negative
constructor
A new instance of Negative.
-
#output ⇒ String
メッセージへの出力.
- #s_exp ⇒ Object
Constructor Details
#initialize(body) ⇒ Negative
Returns a new instance of Negative.
163 164 165 |
# File 'lib/bcdice/arithmetic/node.rb', line 163 def initialize(body) @body = body end |
Instance Method Details
#eval(round_type) ⇒ Object
167 168 169 |
# File 'lib/bcdice/arithmetic/node.rb', line 167 def eval(round_type) -@body.eval(round_type) end |
#output ⇒ String
Returns メッセージへの出力.
172 173 174 |
# File 'lib/bcdice/arithmetic/node.rb', line 172 def output "-#{@body.output}" end |
#s_exp ⇒ Object
176 177 178 |
# File 'lib/bcdice/arithmetic/node.rb', line 176 def s_exp "(- #{@body.s_exp})" end |