Class: FbGraph::User
- Extended by:
- Searchable
- Includes:
- Connections::Accounts, Connections::Activities, Connections::Albums, Connections::AppRequests, Connections::Books, Connections::Checkins, Connections::Events, Connections::Feed, Connections::FriendLists, Connections::Friends, Connections::Games, Connections::Groups, Connections::Home, Connections::Interests, Connections::Likes, Connections::Links, Connections::Movies, Connections::Music, Connections::Notes, Connections::Payments, Connections::Photos, Connections::Picture, Connections::Posts, Connections::Statuses, Connections::Tagged, Connections::Television, Connections::Threads, Connections::Videos
- Defined in:
- lib/fb_graph/user.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#about ⇒ Object
Returns the value of attribute about.
-
#address ⇒ Object
Returns the value of attribute address.
-
#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
Returns the value of attribute favorite_athletes.
-
#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
Returns the value of attribute inspirational_people.
-
#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.
-
#meeting_for ⇒ Object
Returns the value of attribute meeting_for.
-
#mobile_phone ⇒ Object
Returns the value of attribute mobile_phone.
-
#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_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
Returns the value of attribute sports.
-
#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.
-
#verified ⇒ Object
Returns the value of attribute verified.
-
#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
Methods included from Connections::Videos
Methods included from Connections::Threads
Methods included from Connections::Television
Methods included from Connections::Tagged
Methods included from Connections::Statuses
Methods included from Connections::Posts
Methods included from Connections::Picture
Methods included from Connections::Photos
Methods included from Connections::Payments
Methods included from Connections::Notes
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::Home
Methods included from Connections::Groups
Methods included from Connections::Games
Methods included from Connections::Friends
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::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.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 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 |
# File 'lib/fb_graph/user.rb', line 35 def initialize(identifier, attributes = {}) super @first_name = attributes[:first_name] @last_name = attributes[:last_name] @name = attributes[:name] @link = attributes[:link] @about = attributes[:about] if attributes[:birthday] month, day, year = attributes[:birthday].split('/').collect(&:to_i) year ||= 0 @birthday = Date.new(year, month, day) end @work = [] if attributes[:work] attributes[:work].each do |work| @work << Work.new(work) end end @education = [] if attributes[:education] attributes[:education].each do |education| @education << Education.new(education) end end @email = attributes[:email] @website = attributes[:website] if (hometown = attributes[:hometown]) @hometown = Page.new(hometown.delete(:id), hometown) end if (location = attributes[:location]) @location = Page.new(location.delete(:id), location) end @sports = [] if (sports = attributes[:sports]) sports.each do |sport| @sports << Page.new(sport.delete(:id), sport) end end @favorite_teams = [] if attributes[:favorite_teams] attributes[:favorite_teams].each do |favorite_team| @favorite_teams << Page.new(favorite_team.delete(:id), favorite_team) end end @favorite_athletes = [] if attributes[:favorite_athletes] attributes[:favorite_athletes].each do |favorite_athlete| @favorite_athletes << Page.new(favorite_athlete.delete(:id), favorite_athlete) end end @inspirational_people = [] if attributes[:inspirational_people] attributes[:inspirational_people].each do |inspirational_person| @inspirational_people << Page.new(inspirational_person.delete(:id), inspirational_person) end end @bio = attributes[:bio] @quotes = attributes[:quotes] @gender = attributes[:gender] @interested_in = Array(attributes[:interested_in]) @meeting_for = Array(attributes[:meeting_for]) @relationship_status = attributes[:relationship_status] @religion = attributes[:religion] @political = attributes[:political] @verified = attributes[:verified] if (significant_other = attributes[:significant_other]) @significant_other = User.new(significant_other.delete(:id), significant_other) end @timezone = attributes[:timezone] @locale = attributes[:locale] @third_party_id = attributes[:third_party_id] @languages = [] if attributes[:languages] attributes[:languages].each do |language| @languages << Page.new(language.delete(:id), language) end end if attributes[:updated_time] @updated_time = Time.parse(attributes[:updated_time]).utc end if attributes[:address] @address = Venue.new(attributes[:address]) end @mobile_phone = attributes[:mobile_phone] end |
Instance Attribute Details
#about ⇒ Object
Returns the value of attribute about.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def about @about end |
#address ⇒ Object
Returns the value of attribute address.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def address @address end |
#bio ⇒ Object
Returns the value of attribute bio.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def bio @bio end |
#birthday ⇒ Object
Returns the value of attribute birthday.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def birthday @birthday end |
#education ⇒ Object
Returns the value of attribute education.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def education @education end |
#email ⇒ Object
Returns the value of attribute email.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def email @email end |
#favorite_athletes ⇒ Object
Returns the value of attribute favorite_athletes.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def favorite_athletes @favorite_athletes end |
#favorite_teams ⇒ Object
Returns the value of attribute favorite_teams.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def favorite_teams @favorite_teams end |
#first_name ⇒ Object
Returns the value of attribute first_name.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def first_name @first_name end |
#gender ⇒ Object
Returns the value of attribute gender.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def gender @gender end |
#hometown ⇒ Object
Returns the value of attribute hometown.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def hometown @hometown end |
#inspirational_people ⇒ Object
Returns the value of attribute inspirational_people.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def inspirational_people @inspirational_people end |
#interested_in ⇒ Object
Returns the value of attribute interested_in.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def interested_in @interested_in end |
#languages ⇒ Object
Returns the value of attribute languages.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def languages @languages end |
#last_name ⇒ Object
Returns the value of attribute last_name.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def last_name @last_name end |
#link ⇒ Object
Returns the value of attribute link.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def link @link end |
#locale ⇒ Object
Returns the value of attribute locale.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def locale @locale end |
#location ⇒ Object
Returns the value of attribute location.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def location @location end |
#meeting_for ⇒ Object
Returns the value of attribute meeting_for.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def meeting_for @meeting_for end |
#mobile_phone ⇒ Object
Returns the value of attribute mobile_phone.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def mobile_phone @mobile_phone end |
#name ⇒ Object
Returns the value of attribute name.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def name @name end |
#political ⇒ Object
Returns the value of attribute political.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def political @political end |
#quotes ⇒ Object
Returns the value of attribute quotes.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def quotes @quotes end |
#relationship_status ⇒ Object
Returns the value of attribute relationship_status.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def relationship_status @relationship_status end |
#religion ⇒ Object
Returns the value of attribute religion.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def religion @religion end |
#significant_other ⇒ Object
Returns the value of attribute significant_other.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def significant_other @significant_other end |
#sports ⇒ Object
Returns the value of attribute sports.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def sports @sports end |
#third_party_id ⇒ Object
Returns the value of attribute third_party_id.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def third_party_id @third_party_id end |
#timezone ⇒ Object
Returns the value of attribute timezone.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def timezone @timezone end |
#updated_time ⇒ Object
Returns the value of attribute updated_time.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def updated_time @updated_time end |
#verified ⇒ Object
Returns the value of attribute verified.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def verified @verified end |
#website ⇒ Object
Returns the value of attribute website.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def website @website end |
#work ⇒ Object
Returns the value of attribute work.
33 34 35 |
# File 'lib/fb_graph/user.rb', line 33 def work @work end |
Class Method Details
.me(access_token) ⇒ Object
121 122 123 |
# File 'lib/fb_graph/user.rb', line 121 def self.me(access_token) new('me', :access_token => access_token) end |