Seeing code like this makes my teeth ache:

if "#{self.key}".start_with?("XYZ")

*sigh*

Follow

@michaelfromuk some other ones I've seen:

"#{var.to_s}"

YAML.load(File.read(path))
# YAML.load_file exists for this

URL.parse(url.to_s)
# was only necessary before the URI() method was added

Sign in to participate in the conversation
Ruby.social

A Mastodon instance for Rubyists & friends