class PhyshRoller::Die
Attributes
last_result[R]
sides_on_die[R]
Public Class Methods
new(sides_on_die)
click to toggle source
# File lib/physh_roller/die.rb, line 5 def initialize(sides_on_die) @sides_on_die = sides_on_die.to_i @last_result = 0 end
Public Instance Methods
roll()
click to toggle source
# File lib/physh_roller/die.rb, line 10 def roll @last_result = rand(1..@sides_on_die) end