I have a Ruby array containing some string values. I need to:
I'm not sure there is one. The Enumerable module, which adds select
and map
, doesn't show one.
You'd be required to pass in two blocks to the select_and_transform
method, which would be a bit unintuitive IMHO.
Obviously, you could just chain them together, which is more readable:
transformed_list = lines.select{|line| ...}.map{|line| ... }