Class: Lifen::User
Instance Method Summary collapse
- #client ⇒ Object
- #create! ⇒ Object
- #flows ⇒ Object
- #refresh_token ⇒ Object
- #refresh_unread_messages ⇒ Object
Instance Method Details
#client ⇒ Object
44 45 46 |
# File 'lib/lifen/user.rb', line 44 def client UserAuthenticatedClient.new(token) end |
#create! ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/lifen/user.rb', line 16 def create! authentication = Lifen::Authentication.new(user: self) authentication.register! self.token = authentication.token self.uuid = authentication.uuid self end |
#flows ⇒ Object
12 13 14 |
# File 'lib/lifen/user.rb', line 12 def flows Lifen::Flows.new(self).all end |
#refresh_token ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/lifen/user.rb', line 26 def refresh_token authentication = Lifen::Authentication.new(user: self) authentication.refresh_token self.token = authentication.token self end |
#refresh_unread_messages ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/lifen/user.rb', line 35 def status = Lifen::Status.new(user: self) status.refresh self. = status.unread self end |