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, hash_populating_accessor_with_default_field, 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

- (Object) image_url

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

- (Object) large_image_url

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

- (Object) normal_image_url

64.64 pixel image url



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

def normal_image_url
  sized_image_url("normal")
end

- (Object) sized_image_url(size)



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

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

- (Object) small_image_url

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

- (Object) square_image_url

50x50 pixel image url



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

def square_image_url
  sized_image_url("square")
end

- (Object) to_s



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

def to_s
  name
end