There is the following code in RoR:
class Product < ActiveRecord::Base
validates :title, :description, :image_url, presence: true
end
I've read some Ruby books, but I didn't see in OOP paragraph any information about executing methods of class in class (not other method) body! What is it? How does it work? When is this method executed? Please, make me clear in this question. Thanks.