Cheng Cheng - 1 year ago 114
Ruby Question

How to list local-variables in Ruby?

def method
a = 3
b = 4

some_method_that_gives # [a, b]

Answer Source


It outputs array of symbols, presenting variables. In your case: [:a, :b]

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download