I would prefer the first, because calling Foo.foo clearly shows the receiver of the method, and I know that bar is probably defined in foo.rb.
In the second example, it's less clear where bar is defined. Ok, it's clear in your example, but in a situation where the names aren't so simple, bar might be defined in the current class, or bar.rb, or any other module that's mixed into the current class, or all three.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I would prefer the first, because calling
Foo.foo
clearly shows the receiver of the method, and I know thatbar
is probably defined in foo.rb.In the second example, it's less clear where
bar
is defined. Ok, it's clear in your example, but in a situation where the names aren't so simple,bar
might be defined in the current class, or bar.rb, or any other module that's mixed into the current class, or all three.