Class: Proc

Inherits:
Object
  • Object
show all
Defined in:
lib/alda-rb/patches.rb

Overview

Contains patches to Ruby’s core classes.

Instance Method Summary collapse

Instance Method Details

#*(n) ⇒ Object

:call-seq:

proc * n -> n

Runs self for n times.



221
222
223
224
225
226
227
# File 'lib/alda-rb/patches.rb', line 221

def * n
	if !lambda? || arity == 1
		n.times &self
	else
		n.times { self.() }
	end
end