>>16
If you need an object to behave in a certain way, check whether the methods you need are available ("string".respond_to? :split)
If you need an object of a specific class, well, nothing is stopping you from doing "string".is_a? String
Oh, and @somevariable is an instance variable, somevariable is not. They shouldn't be the same.