Class: FbGraph::User

Instance Attribute Summary collapse

Attributes inherited from Node

#access_token, #endpoint, #identifier

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Searchable

search, search

Methods included from Connections::Checkins

#checkins

Methods included from Connections::Accounts

#accounts

Methods included from Connections::Events

#event!, #events

Methods included from Connections::Notes

#note!, #notes

Methods included from Connections::Links

#link!, #links

Methods included from Connections::Statuses

#statuses

Methods included from Connections::Groups

#groups

Methods included from Connections::Videos

#videos

Methods included from Connections::Albums

#album!, #albums

Methods included from Connections::Photos

#photo!, #photos

Methods included from Connections::Likes

#likes

Methods included from Connections::Television

#television

Methods included from Connections::Movies

#movies

Methods included from Connections::Books

#books

Methods included from Connections::Music

#music

Methods included from Connections::Interests

#interests

Methods included from Connections::Activities

#activities

Methods included from Connections::Friends

#friends

Methods included from Connections::Picture

#picture

Methods included from Connections::Posts

#posts

Methods included from Connections::Tagged

#tagged

Methods included from Connections::Feed

#feed, #feed!

Methods included from Connections::Home

#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

#aboutObject

Returns the value of attribute about.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def about
  @about
end

#bioObject

Returns the value of attribute bio.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def bio
  @bio
end

#birthdayObject

Returns the value of attribute birthday.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def birthday
  @birthday
end

#educationObject

Returns the value of attribute education.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def education
  @education
end

#emailObject

Returns the value of attribute email.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def email
  @email
end

#first_nameObject

Returns the value of attribute first_name.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def first_name
  @first_name
end

#genderObject

Returns the value of attribute gender.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def gender
  @gender
end

#hometownObject

Returns the value of attribute hometown.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def hometown
  @hometown
end

#interested_inObject

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_nameObject

Returns the value of attribute last_name.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def last_name
  @last_name
end

Returns the value of attribute link.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def link
  @link
end

#locationObject

Returns the value of attribute location.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def location
  @location
end

#meeting_forObject

Returns the value of attribute meeting_for.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def meeting_for
  @meeting_for
end

#nameObject

Returns the value of attribute name.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def name
  @name
end

#politicalObject

Returns the value of attribute political.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def political
  @political
end

#quotesObject

Returns the value of attribute quotes.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def quotes
  @quotes
end

#relationship_statusObject

Returns the value of attribute relationship_status.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def relationship_status
  @relationship_status
end

#religionObject

Returns the value of attribute religion.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def religion
  @religion
end

#significant_otherObject

Returns the value of attribute significant_other.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def significant_other
  @significant_other
end

#timezoneObject

Returns the value of attribute timezone.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def timezone
  @timezone
end

#updated_timeObject

Returns the value of attribute updated_time.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def updated_time
  @updated_time
end

#verifiedObject

Returns the value of attribute verified.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def verified
  @verified
end

#websiteObject

Returns the value of attribute website.



34
35
36
# File 'lib/fb_graph/user.rb', line 34

def website
  @website
end

#workObject

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