Please trim your quotes. Thank you!
On Wed, Aug 15, 2012 at 6:07 PM, Dave Castellano <[email protected]> wrote:
> I want to place it in the array as a string, evaluate it later...
> eg:
>
> age = "11"
> puts array[0]
The simplest would be
array = [ lambda {|age| "An #{age} year old..."} ]
Then you can do
puts array[0][11]
or
all_strings = array.map {|f| f[11]}
or
single_string = values = array.map {|f| f[11]}.join
Kind regards
robert
--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
-- You received this message because you are subscribed to the Google Groups
ruby-talk-google group. To post to this group, send email to
[email protected]. To unsubscribe from this group, send email
to [email protected]. For more options, visit this
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en