Class: FbGraph::User
- Extended by:
- Searchable
- Includes:
- Connections::Accounts, Connections::Activities, Connections::Albums, Connections::Books, Connections::Checkins, Connections::Events, Connections::Feed, Connections::Friends, Connections::Groups, Connections::Home, Connections::Interests, Connections::Likes, Connections::Links, Connections::Movies, Connections::Music, Connections::Notes, Connections::Photos, Connections::Picture, Connections::Posts, Connections::Statuses, Connections::Tagged, Connections::Television, Connections::Videos
- Defined in:
- lib/fb_graph/user.rb
Instance Attribute Summary collapse
-
#about ⇒ Object
Returns the value of attribute about.
-
#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.
-
#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.
-
#interested_in ⇒ Object
Returns the value of attribute interested_in.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#link ⇒ Object
Returns the value of attribute link.
-
#location ⇒ Object
Returns the value of attribute location.
-
#meeting_for ⇒ Object
Returns the value of attribute meeting_for.
-
#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.
-
#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::Checkins
Methods included from Connections::Accounts
Methods included from Connections::Events
Methods included from Connections::Notes
Methods included from Connections::Links
Methods included from Connections::Statuses
Methods included from Connections::Groups
Methods included from Connections::Videos
Methods included from Connections::Albums
Methods included from Connections::Photos
Methods included from Connections::Likes
Methods included from Connections::Television
Methods included from Connections::Movies
Methods included from Connections::Books
Methods included from Connections::Music
Methods included from Connections::Interests
Methods included from Connections::Activities
Methods included from Connections::Friends
Methods included from Connections::Picture
Methods included from Connections::Posts
Methods included from Connections::Tagged
Methods included from Connections::Feed
Methods included from Connections::Home
Methods inherited from Node
#connection, #destroy, fetch, #fetch
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ User
Returns a new instance of User.
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 |
# File 'lib/fb_graph/user.rb', line 36 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 << FbGraph::Work.new(work) end end @education = [] if attributes[:education] attributes[:education].each do |education| @education << FbGraph::Education.new(education) end end @email = attributes[:email] @website = attributes[:website].to_s.split("\n") if (hometown = attributes[:hometown]) @hometown = FbGraph::Page.new(hometown.delete(:id), hometown) end if (location = attributes[:location]) @location = FbGraph::Page.new(location.delete(:id), location) 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] @significant_other = attributes[:significant_other] # What's this?? @timezone = attributes[:timezone] if attributes[:updated_time] @updated_time = Time.parse(attributes[:updated_time]).utc end end |
Instance Attribute Details
#about ⇒ Object
Returns the value of attribute about.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def about @about end |
#bio ⇒ Object
Returns the value of attribute bio.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def bio @bio end |
#birthday ⇒ Object
Returns the value of attribute birthday.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def birthday @birthday end |
#education ⇒ Object
Returns the value of attribute education.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def education @education end |
#email ⇒ Object
Returns the value of attribute email.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def email @email end |
#first_name ⇒ Object
Returns the value of attribute first_name.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def first_name @first_name end |
#gender ⇒ Object
Returns the value of attribute gender.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def gender @gender end |
#hometown ⇒ Object
Returns the value of attribute hometown.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def hometown @hometown end |
#interested_in ⇒ Object
Returns the value of attribute interested_in.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def interested_in @interested_in end |
#last_name ⇒ Object
Returns the value of attribute last_name.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def last_name @last_name end |
#link ⇒ Object
Returns the value of attribute link.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def link @link end |
#location ⇒ Object
Returns the value of attribute location.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def location @location end |
#meeting_for ⇒ Object
Returns the value of attribute meeting_for.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def meeting_for @meeting_for end |
#name ⇒ Object
Returns the value of attribute name.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def name @name end |
#political ⇒ Object
Returns the value of attribute political.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def political @political end |
#quotes ⇒ Object
Returns the value of attribute quotes.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def quotes @quotes end |
#relationship_status ⇒ Object
Returns the value of attribute relationship_status.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def relationship_status @relationship_status end |
#religion ⇒ Object
Returns the value of attribute religion.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def religion @religion end |
#significant_other ⇒ Object
Returns the value of attribute significant_other.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def significant_other @significant_other end |
#timezone ⇒ Object
Returns the value of attribute timezone.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def timezone @timezone end |
#updated_time ⇒ Object
Returns the value of attribute updated_time.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def updated_time @updated_time end |
#verified ⇒ Object
Returns the value of attribute verified.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def verified @verified end |
#website ⇒ Object
Returns the value of attribute website.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def website @website end |
#work ⇒ Object
Returns the value of attribute work.
34 35 36 |
# File 'lib/fb_graph/user.rb', line 34 def work @work end |
Class Method Details
.me(access_token) ⇒ Object
84 85 86 |
# File 'lib/fb_graph/user.rb', line 84 def self.me(access_token) new('me', :access_token => access_token) end |