class BCDice::CommonCommand::AddDice::Node::Number
数値のノード
Attributes
literal[R]
値 @return [Integer]
Public Class Methods
new(literal)
click to toggle source
ノードを初期化する @param [Integer] literal 値
# File lib/bcdice/common_command/add_dice/node.rb, line 601 def initialize(literal) @literal = literal end
Public Instance Methods
eval(_game_system, _randomizer)
click to toggle source
ノードを評価する @return [Integer] 格納している値
# File lib/bcdice/common_command/add_dice/node.rb, line 613 def eval(_game_system, _randomizer) @literal end
expr(_game_system)
click to toggle source
文字列に変換する @return [String]
# File lib/bcdice/common_command/add_dice/node.rb, line 624 def expr(_game_system) @literal.to_s end
include_dice?()
click to toggle source
@return [Boolean]
# File lib/bcdice/common_command/add_dice/node.rb, line 618 def include_dice? false end
negate()
click to toggle source
符号を反転した結果の数値ノードを返す @return [Number]
# File lib/bcdice/common_command/add_dice/node.rb, line 607 def negate Number.new(-@literal) end
output()
click to toggle source
# File lib/bcdice/common_command/add_dice/node.rb, line 628 def output @literal.to_s end
Also aliased as: s_exp