Class: Lifen::User

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

Instance Method Summary collapse

Instance Method Details

#client ⇒ Object



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

def client
  UserAuthenticatedClient.new(token)
end

#create! ⇒ Object



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

def create!
  authentication = Lifen::Authentication.new(user: self)
  authentication.register!

  self.token = authentication.token
  self.uuid = authentication.uuid

  self
end

#flows ⇒ Object



11
12
13
# File 'lib/lifen/user.rb', line 11

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

#refresh_token ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/lifen/user.rb', line 25

def refresh_token
  authentication = Lifen::Authentication.new(user: self)
  authentication.refresh_token

  self.token = authentication.token

  self
end