end def deleted? self.deleted_at.present? end def recover! self.deleted_at = nil end end class User include SoftDelete def initialize(name) @name = name end end class Post include SoftDelete def initialize(title) @title = title end end
and receiving messages Every object is an instance of a class Objects have their own memory, which consists of other objects. The class is the repository for behavior associated with an object.