Hi:
consider
def foo(i)
case i
when ‘foo’,‘bar’,
‘bla’
call_this
when ‘yo’
call_ok
end
end
Is there a simple way to programmatically get all entries of a given
case menu?
So I would get an array like:
[‘foo’,‘bar’,‘bla’,‘yo’]
?
Hi:
consider
def foo(i)
case i
when ‘foo’,‘bar’,
‘bla’
call_this
when ‘yo’
call_ok
end
end
Is there a simple way to programmatically get all entries of a given
case menu?
So I would get an array like:
[‘foo’,‘bar’,‘bla’,‘yo’]
?
The only way I could think of to do that would be to read and parse the
text file containing the code. Then it’s a bit of regex to isolate the
case statement and pull out the entries.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs