Class: Omnisocial::FacebookAccount

Inherits:
LoginAccount
  • Object
show all
Defined in:
app/models/omnisocial/facebook_account.rb

Instance Method Summary collapse

Methods inherited from LoginAccount

create_from_auth_hash, find_or_create_from_auth_hash

Instance Method Details

#account_urlObject



10
11
12
# File 'app/models/omnisocial/facebook_account.rb', line 10

def 
  "http://facebook.com/#{self.}"
end

#assign_account_info(auth_hash) ⇒ Object



3
4
5
6
7
8
# File 'app/models/omnisocial/facebook_account.rb', line 3

def (auth_hash)
  self.token              = auth_hash['credentials']['token']
  self.  = auth_hash['uid']
  self.              = auth_hash['user_info']['nickname']
  self.name               = auth_hash['user_info']['name']
end

#picture_urlObject



14
15
16
17
18
19
20
# File 'app/models/omnisocial/facebook_account.rb', line 14

def picture_url
  if self..include?('profile.php')
    "https://graph.facebook.com/#{self..gsub(/[^\d]/, '')}/picture?type=square"
  else
    "https://graph.facebook.com/#{self.}/picture?type=square"
  end
end