Class: MiniFB::User
- Inherits:
-
Object
- Object
- MiniFB::User
- Defined in:
- lib/mini_fb.rb
Constant Summary collapse
- FIELDS =
[:uid, :status, :political, :pic_small, :name, :quotes, :is_app_user, :tv, :profile_update_time, :meeting_sex, :hs_info, :timezone, :relationship_status, :hometown_location, :about_me, :wall_count, :significant_other_id, :pic_big, :music, :work_history, :sex, :religion, :notes_count, :activities, :pic_square, :movies, :has_added_app, :education_history, :birthday, :birthday_date, :first_name, :meeting_for, :last_name, :interests, :current_location, :pic, :books, :affiliations, :locale, :profile_url, :proxied_email, :email, :email_hashes, :allowed_restrictions, :pic_with_logo, :pic_big_with_logo, :pic_small_with_logo, :pic_square_with_logo]
- STANDARD_FIELDS =
[:uid, :first_name, :last_name, :name, :timezone, :birthday, :sex, :affiliations, :locale, :profile_url, :proxied_email, :email]
Class Method Summary collapse
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(fb_hash, session) ⇒ User
constructor
A new instance of User.
- #merge_aid(aid, uid) ⇒ Object
- #profile_photos ⇒ Object
- #profile_pic_album_id ⇒ Object
- #uid ⇒ Object
Constructor Details
#initialize(fb_hash, session) ⇒ User
Returns a new instance of User.
113 114 115 116 |
# File 'lib/mini_fb.rb', line 113 def initialize(fb_hash, session) @fb_hash = fb_hash @session = session end |
Class Method Details
.all_fields ⇒ Object
105 106 107 |
# File 'lib/mini_fb.rb', line 105 def self.all_fields FIELDS.join(",") end |
.standard_fields ⇒ Object
109 110 111 |
# File 'lib/mini_fb.rb', line 109 def self.standard_fields STANDARD_FIELDS.join(",") end |
Instance Method Details
#[](key) ⇒ Object
118 119 120 |
# File 'lib/mini_fb.rb', line 118 def [](key) @fb_hash[key] end |
#merge_aid(aid, uid) ⇒ Object
134 135 136 137 138 139 |
# File 'lib/mini_fb.rb', line 134 def merge_aid(aid, uid) uid = uid.to_i ret = (uid << 32) + (aid & 0xFFFFFFFF) # puts 'merge_aid=' + ret.inspect return ret end |
#profile_photos ⇒ Object
126 127 128 |
# File 'lib/mini_fb.rb', line 126 def profile_photos @session.photos.get("uid"=>uid, "aid"=>profile_pic_album_id) end |
#profile_pic_album_id ⇒ Object
130 131 132 |
# File 'lib/mini_fb.rb', line 130 def profile_pic_album_id merge_aid(-3, uid) end |
#uid ⇒ Object
122 123 124 |
# File 'lib/mini_fb.rb', line 122 def uid return self["uid"] end |