Skip to content

Instantly share code, notes, and snippets.

Created May 4, 2016 02:55
Show Gist options
  • Save anonymous/1bd82a200532265a3a24bea023e26c9d to your computer and use it in GitHub Desktop.
Save anonymous/1bd82a200532265a3a24bea023e26c9d to your computer and use it in GitHub Desktop.
def func(line)
$myVar = []
comms = line.split(" ")[0]
case comms[0]
when "classA"
$myVar = classA.new(comms[1])
when "doB"
b = ClassB.new("abc")
$myVar.add(b) #I am having error in this line. Add is a function of class A, but here its giving nil error
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment