Maybe it is a stupid question, but i'm new to ruby, and I googled it, found these:
proc=Proc.new {|x| deal_with(x)}
a_lambda = lambda {|a| puts a}
But I want this:
def forward_slash_to_back(string)
...
def back_slash_to_forward(string)
...
def add_back_slash_for_post(string)
...
...
case conversion_type
when /bf/i then proc=&back_slash_to_forward
when /fb/i then proc=&forward_slash_to_back
when /ad/i then proc=&add_back_slash_for_post
else proc=&add_back_slash_for_post
end
n_data=proc.call(c_data)
But it gives me an error. I don't know how to do that in Ruby, anyone can help? thanks a lot!