class BCDice::DiceTable::RollResult
Attributes
body[R]
@return [String, RollResult]
table_name[R]
@return [String]
value[R]
@return [Integer]
Public Class Methods
new(table_name, value, body)
click to toggle source
@param table_name
[String] @param value [Integer] @param body [String, RollResult]
# File lib/bcdice/dice_table/roll_result.rb, line 9 def initialize(table_name, value, body) @table_name = table_name @value = value @body = body end
Public Instance Methods
empty?()
click to toggle source
一部のゲームシステムが String#empty? を想定してチェックしているため @return [false]
# File lib/bcdice/dice_table/roll_result.rb, line 40 def empty? false end
last_body()
click to toggle source
@return [String]
# File lib/bcdice/dice_table/roll_result.rb, line 30 def last_body if @body.is_a?(RollResult) @body.last_body else @body end end
to_s()
click to toggle source
@return [String]
# File lib/bcdice/dice_table/roll_result.rb, line 25 def to_s "#{@table_name}(#{@value}) > #{@body}" end