Module: RollPartString

Included in:
DiceBag::RollPart
Defined in:
lib/dicebag/roll_part_string.rb

Overview

This encapsulates the RollPart string generation methods.

Instance Method Summary collapse

Instance Method Details

#to_s(no_spaces = false) ⇒ Object

This takes the @parts hash and recreates the xDx string. Optionally, passing true to the method will remove spaces form the finished string.



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/dicebag/roll_part_string.rb', line 9

def to_s(no_spaces = false)
  @string = ''
  @space  = (no_spaces ? '' : ' ')

  to_s_xdx
  to_s_explode
  to_s_drop
  to_s_keep
  to_s_reroll
  to_s_target

  @string
end