Class: Integer
- Inherits:
-
Object
show all
- Defined in:
- lib/rdgc/util/random_util.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
65
66
67
|
# File 'lib/rdgc/util/random_util.rb', line 65
def method_missing(name, *args)
try_define_dice(name, args) ? (__send__ name) : super
end
|
Instance Method Details
#d10 ⇒ Object
77
78
79
|
# File 'lib/rdgc/util/random_util.rb', line 77
def d10
self.dice(10)
end
|
#d4 ⇒ Object
69
70
71
|
# File 'lib/rdgc/util/random_util.rb', line 69
def d4
self.dice(4)
end
|
#d6 ⇒ Object
73
74
75
|
# File 'lib/rdgc/util/random_util.rb', line 73
def d6
self.dice(6)
end
|
#dice(max) ⇒ Object
Also known as:
d