module Lifen class Status include Virtus.model(finalize: false) attribute :user, "Lifen::User" attribute :unread, Integer, default: 0 def reload json = client.get("central/api/chats/status") self.unread = json["unread"] self end alias refresh reload private def client @client ||= user.client end end end