Class: Mingle::Facebook::Post

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/mingle/facebook/post.rb

Instance Method Summary collapse

Instance Method Details

#authorObject



29
30
31
# File 'app/models/mingle/facebook/post.rb', line 29

def author
  user_name
end

#avatarObject



33
34
35
# File 'app/models/mingle/facebook/post.rb', line 33

def avatar
  profile_image_url
end

#large_pictureObject

Large pictures are not directly provided through the Graph API Note: Not a documented Facebook feature and may potentially break in the future



17
18
19
# File 'app/models/mingle/facebook/post.rb', line 17

def large_picture
  picture.gsub(/_(?:s|t)\.(jpg|jpeg|png|gif)$/, '_b.\1') if picture.present?
end

#profile_image_urlObject



25
26
27
# File 'app/models/mingle/facebook/post.rb', line 25

def profile_image_url
  "https://graph.facebook.com/#{user_id}/picture" if user_id.present?
end

#profile_urlObject



21
22
23
# File 'app/models/mingle/facebook/post.rb', line 21

def profile_url
  "https://www.facebook.com/#{user_id}" if user_id.present?
end