On Mon, May 13, 2013 at 7:19 AM, Love U Ruby wrote:
> ObjectSpace.each_object(Class).to_a.grep(/(stri)/i)
>
ObjectSpace.each_object(Class).select { |x| x.to_s =~ /stri/i }
=> [String, RubyToken::TkDXSTRING, RubyToken::TkDSTRING,
RubyToken::TkXSTRING, RubyToken::TkSTRING]
(Hello from Ruby 2.0)
I was trying to list the all the class names having the pattern `stri`
with the below:
p ObjectSpace.each_object(Class).to_a.grep(/(stri)/i) #=> []
But not getting the output. So can anyone help me on the same?
Thanks
--
Posted via http://www.ruby-forum.com/.
--
You received this message bec
2 matches
Mail list logo