This is not specific for Rails - I am just using Rails as an example.
I have a model in Rails:
class Item < ActiveRecord::Base
def hello
puts "Hello, #{self.name}"
end
end
(Let's assume that the Item model (class) has a method called name.) When do I need to use self.name and when can I just use name (e.g., #{name})?