Class: Die

Inherits:
Object
  • Object
show all
Includes:
Auditable
Defined in:
lib/dry_game/die.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Auditable

#audit

Constructor Details

#initializeDie

Returns a new instance of Die.



7
8
9
# File 'lib/dry_game/die.rb', line 7

def initialize
  roll
end

Instance Attribute Details

#numberObject (readonly)

Returns the value of attribute number.



5
6
7
# File 'lib/dry_game/die.rb', line 5

def number
  @number
end

Instance Method Details

#rollObject



10
11
12
# File 'lib/dry_game/die.rb', line 10

def roll
  @number = rand(1..6)
end