Class: Lifen::User

Inherits:
Object
  • Object
show all
Defined in:
lib/lifen/user.rb

Instance Method Summary collapse

Instance Method Details

#clientObject



42
43
44
# File 'lib/lifen/user.rb', line 42

def client
  UserAuthenticatedClient.new(token)
end

#createObject



17
18
19
20
21
22
23
# File 'lib/lifen/user.rb', line 17

def create
  params = {emailAddress: email, lastName: last_name, firstName: first_name}

  json = application_client.post("authentication/api/register/third_party", params)

  self.uuid = json["accountUuid"]
end

#flowsObject



13
14
15
# File 'lib/lifen/user.rb', line 13

def flows
  Lifen::Flows.new(user: self).all
end

#statusObject



38
39
40
# File 'lib/lifen/user.rb', line 38

def status
  @status ||= Lifen::Status.new(user: self)
end

#tokenObject



29
30
31
# File 'lib/lifen/user.rb', line 29

def token
  @token ||= Lifen::Token.new(user: self)
end

#token=(token) ⇒ Object



33
34
35
36
# File 'lib/lifen/user.rb', line 33

def token=(token)
  token.user = self
  @token = token
end

#unread_messagesObject



25
26
27
# File 'lib/lifen/user.rb', line 25

def unread_messages
  status.unread
end