Class: Integer
- Inherits:
-
Object
- Object
- Integer
- Defined in:
- lib/sixarm_ruby_integer_map/integer/map.rb
Overview
Please see README
Instance Method Summary collapse
-
#map ⇒ Object
Syntactic sugar to yield n times to a block.
Instance Method Details
#map ⇒ Object
Syntactic sugar to yield n times to a block.
## Comparison to Integer#times
Integer#maps is similar to Integer#times except that the output from each call to the block is captured in an array element and that array is returned to the calling code.
26 27 28 |
# File 'lib/sixarm_ruby_integer_map/integer/map.rb', line 26 def map self.times.map{|i| yield i} end |