module Lifen class User < Base attribute :uuid, String attribute :token, String attribute :email, String attribute :last_name, String attribute :first_name, String def flows Lifen::Flows.new(self).all end def create! authentication = Lifen::Authentication.new(user: self) authentication.register! self.token = authentication.token self.uuid = authentication.uuid self end def refresh_token authentication = Lifen::Authentication.new(user: self) authentication.refresh_token self.token = authentication.token self end def client UserAuthenticatedClient.new(token) end end end