Class: Mogli::Profile

Inherits:
Model
  • Object
show all
Defined in:
lib/mogli/profile.rb

Direct Known Subclasses

Page, User

Instance Attribute Summary

Attributes inherited from Model

#type

Attributes included from Model::Search

#search_type

Instance Method Summary collapse

Methods inherited from Model

#==, add_creation_method, #client, #client=, creation_keys, creation_properties, define_properties, #destroy, #fetch, find, fql_mapping, has_association, hash_populating_accessor, included, #initialize, #merge!, #method_missing, #post_params, property, recognize?, #warn_about_invalid_property

Methods included from Model::Search

#search

Constructor Details

This class inherits a constructor from Mogli::Model

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Mogli::Model

Instance Method Details

#image_urlObject

Facebook’s defaults image url, which seems to be the same as square_image_url at this time



21
22
23
# File 'lib/mogli/profile.rb', line 21

def image_url
  "https://graph.facebook.com/#{id}/picture"
end

#large_image_urlObject

About 200 pixels wide, variable height image url



41
42
43
# File 'lib/mogli/profile.rb', line 41

def large_image_url
  sized_image_url("large")
end

#normal_image_urlObject

64.64 pixel image url



36
37
38
# File 'lib/mogli/profile.rb', line 36

def normal_image_url
  sized_image_url("normal")
end

#sized_image_url(size) ⇒ Object



45
46
47
# File 'lib/mogli/profile.rb', line 45

def sized_image_url(size)
  "#{image_url}?type=#{size}"
end

#small_image_urlObject

50 pixels wide, variable height image url



31
32
33
# File 'lib/mogli/profile.rb', line 31

def small_image_url
  sized_image_url("small")
end

#square_image_urlObject

50x50 pixel image url



26
27
28
# File 'lib/mogli/profile.rb', line 26

def square_image_url
  sized_image_url("square")
end

#to_sObject



49
50
51
# File 'lib/mogli/profile.rb', line 49

def to_s
  name
end