Module: RollString

Included in:
DiceBag::Roll
Defined in:
lib/dicebag/roll_string.rb

Overview

This encapsulates the Roll class’ string generation methods.

Instance Method Summary collapse

Instance Method Details

#to_s(no_spaces = false) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/dicebag/roll_string.rb', line 6

def to_s(no_spaces = false)
  @parts = []

  to_s_tree

  str = @parts.join ' '

  no_spaces ? str.tr(' ', '') : str
end