each

ary.each { |item| block } â ary
ary.each â Enumerator
Instance Public methods

Calls the given block once for each element in self, passing that element as a parameter.

An Enumerator is returned if no block is given.

a = [ "a", "b", "c" ]
a.each {|x| print x, " -- " }

produces:

a -- b -- c --
doc_ruby_on_rails
2015-03-30 16:38:48
Comments
Leave a Comment

Please login to continue.