Class: FbGraph::User
- Extended by:
- Searchable
- Includes:
- Connections::Accounts, Connections::Activities, Connections::AdAccounts, Connections::Albums, Connections::AppRequests, Connections::Books, Connections::Checkins, Connections::Events, Connections::Family, Connections::Feed, Connections::FriendLists, Connections::FriendRequests, Connections::Friends, Connections::Games, Connections::Groups, Connections::Home, Connections::Inbox, Connections::Interests, Connections::Likes, Connections::Links, Connections::Movies, Connections::Music, Connections::MutualFriends, Connections::Notes, Connections::Notifications, Connections::Outbox, Connections::Payments, Connections::Permissions, Connections::Photos, Connections::Picture, Connections::Pokes, Connections::Posts, Connections::Questions, Connections::Scores, Connections::Statuses, Connections::SubscribedTo, Connections::Subscribers, Connections::Tagged, Connections::Television, Connections::Threads, Connections::UserAchievements, Connections::UserLikes, Connections::Videos, OpenGraph::UserContext
- Defined in:
- lib/fb_graph/user.rb
Instance Attribute Summary collapse
-
#about ⇒ Object
Returns the value of attribute about.
-
#address ⇒ Object
NOTE: below are non-documented.
-
#bio ⇒ Object
Returns the value of attribute bio.
-
#birthday ⇒ Object
Returns the value of attribute birthday.
-
#education ⇒ Object
Returns the value of attribute education.
-
#email ⇒ Object
Returns the value of attribute email.
-
#favorite_athletes ⇒ Object
NOTE: below are non-documented.
-
#favorite_teams ⇒ Object
Returns the value of attribute favorite_teams.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#gender ⇒ Object
Returns the value of attribute gender.
-
#hometown ⇒ Object
Returns the value of attribute hometown.
-
#inspirational_people ⇒ Object
NOTE: below are non-documented.
-
#installed ⇒ Object
NOTE: below are non-documented.
-
#interested_in ⇒ Object
Returns the value of attribute interested_in.
-
#languages ⇒ Object
Returns the value of attribute languages.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#link ⇒ Object
Returns the value of attribute link.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#location ⇒ Object
Returns the value of attribute location.
-
#middle_name ⇒ Object
Returns the value of attribute middle_name.
-
#mobile_phone ⇒ Object
NOTE: below are non-documented.
-
#name ⇒ Object
Returns the value of attribute name.
-
#political ⇒ Object
Returns the value of attribute political.
-
#quotes ⇒ Object
Returns the value of attribute quotes.
-
#relationship ⇒ Object
Returns the value of attribute relationship.
-
#relationship_status ⇒ Object
Returns the value of attribute relationship_status.
-
#religion ⇒ Object
Returns the value of attribute religion.
-
#significant_other ⇒ Object
Returns the value of attribute significant_other.
-
#sports ⇒ Object
NOTE: below are non-documented.
-
#third_party_id ⇒ Object
Returns the value of attribute third_party_id.
-
#timezone ⇒ Object
Returns the value of attribute timezone.
-
#updated_time ⇒ Object
Returns the value of attribute updated_time.
-
#username ⇒ Object
Returns the value of attribute username.
-
#verified ⇒ Object
Returns the value of attribute verified.
-
#video_upload_limits ⇒ Object
Returns the value of attribute video_upload_limits.
-
#website ⇒ Object
Returns the value of attribute website.
-
#work ⇒ Object
Returns the value of attribute work.
Attributes inherited from Node
#access_token, #endpoint, #identifier
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(identifier, attributes = {}) ⇒ User
constructor
A new instance of User.
Methods included from Searchable
search, search, search_query_param
Methods included from OpenGraph::UserContext
Methods included from Connections::Videos
Methods included from Connections::UserLikes
Methods included from Connections::UserAchievements
#achieve!, #achievements, #unachieve!
Methods included from Connections::Threads
Methods included from Connections::Television
Methods included from Connections::Tagged
Methods included from Connections::Subscribers
Methods included from Connections::SubscribedTo
Methods included from Connections::Statuses
Methods included from Connections::Scores
Methods included from Connections::Questions
Methods included from Connections::Posts
Methods included from Connections::Pokes
Methods included from Connections::Picture
Methods included from Connections::Photos
Methods included from Connections::Permissions
Methods included from Connections::Payments
Methods included from Connections::Outbox
Methods included from Connections::Notifications
Methods included from Connections::Notes
Methods included from Connections::MutualFriends
Methods included from Connections::Music
Methods included from Connections::Movies
Methods included from Connections::Links
Methods included from Connections::Likes
Methods included from Connections::Interests
Methods included from Connections::Inbox
Methods included from Connections::Home
Methods included from Connections::Groups
Methods included from Connections::Games
Methods included from Connections::Family
Methods included from Connections::Friends
Methods included from Connections::FriendRequests
Methods included from Connections::FriendLists
Methods included from Connections::Feed
Methods included from Connections::Events
Methods included from Connections::Checkins
Methods included from Connections::Books
Methods included from Connections::AppRequests
Methods included from Connections::Albums
Methods included from Connections::Activities
Methods included from Connections::AdAccounts
Methods included from Connections::Accounts
Methods inherited from Node
#connection, #destroy, fetch, #fetch, #update
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ User
Returns a new instance of User.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/fb_graph/user.rb', line 54 def initialize(identifier, attributes = {}) super @name = attributes[:name] @first_name = attributes[:first_name] @middle_name = attributes[:middle_name] @last_name = attributes[:last_name] @gender = attributes[:gender] @locale = attributes[:locale] @languages = [] if attributes[:languages] attributes[:languages].each do |language| @languages << Page.new(language[:id], language) end end @link = attributes[:link] @username = attributes[:username] @third_party_id = attributes[:third_party_id] @timezone = attributes[:timezone] if attributes[:updated_time] @updated_time = Time.parse(attributes[:updated_time]).utc end @verified = attributes[:verified] @about = attributes[:about] @bio = attributes[:bio] if attributes[:birthday] month, day, year = attributes[:birthday].split('/').collect(&:to_i) year ||= 0 @birthday = Date.new(year, month, day) end @education = [] if attributes[:education] attributes[:education].each do |education| @education << Education.new(education) end end @email = attributes[:email] if (hometown = attributes[:hometown]) @hometown = Page.new(hometown[:id], hometown) end @interested_in = Array(attributes[:interested_in]) if (location = attributes[:location]) @location = Page.new(location[:id], location) end @political = attributes[:political] @favorite_teams = [] if attributes[:favorite_teams] attributes[:favorite_teams].each do |favorite_team| @favorite_teams << Page.new(favorite_team[:id], favorite_team) end end @quotes = attributes[:quotes] @relationship_status = attributes[:relationship_status] @religion = attributes[:religion] if (significant_other = attributes[:significant_other]) @significant_other = User.new(significant_other[:id], significant_other) end # If this user was build from the family connection, set the relationship type @relationship = attributes[:relationship] # NOTE: couldn't find "video_upload_limits" in the response.. # @video_upload_limits = ?? @website = attributes[:website] @work = [] if attributes[:work] attributes[:work].each do |work| @work << Work.new(work) end end # NOTE: below are non-documented @sports = [] if (sports = attributes[:sports]) sports.each do |sport| @sports << Page.new(sport[:id], sport) end end @favorite_athletes = [] if attributes[:favorite_athletes] attributes[:favorite_athletes].each do |favorite_athlete| @favorite_athletes << Page.new(favorite_athlete[:id], favorite_athlete) end end @inspirational_people = [] if attributes[:inspirational_people] attributes[:inspirational_people].each do |inspirational_person| @inspirational_people << Page.new(inspirational_person[:id], inspirational_person) end end if attributes[:address] @address = Venue.new(attributes[:address]) end @mobile_phone = attributes[:mobile_phone] @installed = attributes[:installed] end |
Instance Attribute Details
#about ⇒ Object
Returns the value of attribute about.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def about @about end |
#address ⇒ Object
NOTE: below are non-documented
52 53 54 |
# File 'lib/fb_graph/user.rb', line 52 def address @address end |
#bio ⇒ Object
Returns the value of attribute bio.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def bio @bio end |
#birthday ⇒ Object
Returns the value of attribute birthday.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def birthday @birthday end |
#education ⇒ Object
Returns the value of attribute education.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def education @education end |
#email ⇒ Object
Returns the value of attribute email.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def email @email end |
#favorite_athletes ⇒ Object
NOTE: below are non-documented
52 53 54 |
# File 'lib/fb_graph/user.rb', line 52 def favorite_athletes @favorite_athletes end |
#favorite_teams ⇒ Object
Returns the value of attribute favorite_teams.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def favorite_teams @favorite_teams end |
#first_name ⇒ Object
Returns the value of attribute first_name.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def first_name @first_name end |
#gender ⇒ Object
Returns the value of attribute gender.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def gender @gender end |
#hometown ⇒ Object
Returns the value of attribute hometown.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def hometown @hometown end |
#inspirational_people ⇒ Object
NOTE: below are non-documented
52 53 54 |
# File 'lib/fb_graph/user.rb', line 52 def inspirational_people @inspirational_people end |
#installed ⇒ Object
NOTE: below are non-documented
52 53 54 |
# File 'lib/fb_graph/user.rb', line 52 def installed @installed end |
#interested_in ⇒ Object
Returns the value of attribute interested_in.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def interested_in @interested_in end |
#languages ⇒ Object
Returns the value of attribute languages.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def languages @languages end |
#last_name ⇒ Object
Returns the value of attribute last_name.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def last_name @last_name end |
#link ⇒ Object
Returns the value of attribute link.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def link @link end |
#locale ⇒ Object
Returns the value of attribute locale.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def locale @locale end |
#location ⇒ Object
Returns the value of attribute location.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def location @location end |
#middle_name ⇒ Object
Returns the value of attribute middle_name.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def middle_name @middle_name end |
#mobile_phone ⇒ Object
NOTE: below are non-documented
52 53 54 |
# File 'lib/fb_graph/user.rb', line 52 def mobile_phone @mobile_phone end |
#name ⇒ Object
Returns the value of attribute name.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def name @name end |
#political ⇒ Object
Returns the value of attribute political.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def political @political end |
#quotes ⇒ Object
Returns the value of attribute quotes.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def quotes @quotes end |
#relationship ⇒ Object
Returns the value of attribute relationship.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def relationship @relationship end |
#relationship_status ⇒ Object
Returns the value of attribute relationship_status.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def relationship_status @relationship_status end |
#religion ⇒ Object
Returns the value of attribute religion.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def religion @religion end |
#significant_other ⇒ Object
Returns the value of attribute significant_other.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def significant_other @significant_other end |
#sports ⇒ Object
NOTE: below are non-documented
52 53 54 |
# File 'lib/fb_graph/user.rb', line 52 def sports @sports end |
#third_party_id ⇒ Object
Returns the value of attribute third_party_id.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def third_party_id @third_party_id end |
#timezone ⇒ Object
Returns the value of attribute timezone.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def timezone @timezone end |
#updated_time ⇒ Object
Returns the value of attribute updated_time.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def updated_time @updated_time end |
#username ⇒ Object
Returns the value of attribute username.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def username @username end |
#verified ⇒ Object
Returns the value of attribute verified.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def verified @verified end |
#video_upload_limits ⇒ Object
Returns the value of attribute video_upload_limits.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def video_upload_limits @video_upload_limits end |
#website ⇒ Object
Returns the value of attribute website.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def website @website end |
#work ⇒ Object
Returns the value of attribute work.
49 50 51 |
# File 'lib/fb_graph/user.rb', line 49 def work @work end |
Class Method Details
.me(access_token) ⇒ Object
148 149 150 |
# File 'lib/fb_graph/user.rb', line 148 def self.me(access_token) new('me', :access_token => access_token) end |