RAA - merlin-each

merlin-each / 0.1.0

Short description: JSTL-like each-with-status mixin for Array, Hash and ENV.
Category: Library/Syntax
Status: stable
Created: 2004-02-24 20:36:39 GMT
Last update: -
Owner: merlin (Projects of this owner)
Homepage: http://merlin.org/ruby/#merlin-each
Download: http://merlin.org/ruby/#merlin-each
License: LGPL
Dependency:
None
Description:

JSTL-like each-with-status mixin for Array, Hash and ENV.

Executes a block for each item in an Array, Hash or ENV, with a status object holding iterator information:

[ 'foo', 'bar', 'baz' ].each_with_status { |value, status|
if status.first?
print value
elsif !status.last?
print ", ", value
else
print " or ", value
end
} # prints "foo, bar or baz".

Edit this project (for project owner)

back to RAA top