Class: Turl::TwitterUser

Inherits:
ApplicationRecord show all
Defined in:
lib/turl/twitter_user.rb

Class Method Summary collapse

Class Method Details

.from_response!(resp) ⇒ Object



5
6
7
8
9
# File 'lib/turl/twitter_user.rb', line 5

def self.from_response!(resp)
  find_or_initialize_by(twitter_id: resp.id).tap do |u|
    u.update!(screen_name: resp.screen_name)
  end
end