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 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

#destroy, fetch, #fetch

Methods included from Comparison

#==

Constructor Details

#initialize(identifier, options = {}) ⇒ User

Returns a new instance of User.



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/fb_graph/user.rb', line 32

def initialize(identifier, options = {})
  super
  @name       = options[:name]
  @last_name  = options[:last_name]
  @first_name = options[:first_name]
  @link       = options[:link]
  @about      = options[:about]
  @email      = options[:email]
  if options[:birthday]
    month, day, year = options[:birthday].split('/').collect(&:to_i)
    year ||= 0
    @birthday = Date.new(year, month, day)
  end
  @work = []
  if options[:work]
    options[:work].each do |work|
      @work << FbGraph::Work.new(work)
    end
  end
  @education = []
  if options[:education]
    options[:education].each do |education|
      @education << FbGraph::Education.new(education)
    end
  end
  @website = options[:website].to_s.split("\n")
end

Instance Attribute Details

#aboutObject

TODO: include Connections::Inbox include Connections::Outbox include Connections::Updates



30
31
32
# File 'lib/fb_graph/user.rb', line 30

def about
  @about
end

#birthdayObject

TODO: include Connections::Inbox include Connections::Outbox include Connections::Updates



30
31
32
# File 'lib/fb_graph/user.rb', line 30

def birthday
  @birthday
end

#educationObject

TODO: include Connections::Inbox include Connections::Outbox include Connections::Updates



30
31
32
# File 'lib/fb_graph/user.rb', line 30

def education
  @education
end

#emailObject

TODO: include Connections::Inbox include Connections::Outbox include Connections::Updates



30
31
32
# File 'lib/fb_graph/user.rb', line 30

def email
  @email
end

#first_nameObject

TODO: include Connections::Inbox include Connections::Outbox include Connections::Updates



30
31
32
# File 'lib/fb_graph/user.rb', line 30

def first_name
  @first_name
end

#last_nameObject

TODO: include Connections::Inbox include Connections::Outbox include Connections::Updates



30
31
32
# File 'lib/fb_graph/user.rb', line 30

def last_name
  @last_name
end

TODO: include Connections::Inbox include Connections::Outbox include Connections::Updates



30
31
32
# File 'lib/fb_graph/user.rb', line 30

def link
  @link
end

#nameObject

TODO: include Connections::Inbox include Connections::Outbox include Connections::Updates



30
31
32
# File 'lib/fb_graph/user.rb', line 30

def name
  @name
end

#websiteObject

TODO: include Connections::Inbox include Connections::Outbox include Connections::Updates



30
31
32
# File 'lib/fb_graph/user.rb', line 30

def website
  @website
end

#workObject

TODO: include Connections::Inbox include Connections::Outbox include Connections::Updates



30
31
32
# File 'lib/fb_graph/user.rb', line 30

def work
  @work
end

Class Method Details

.me(access_token) ⇒ Object



60
61
62
# File 'lib/fb_graph/user.rb', line 60

def self.me(access_token)
  new('me', :access_token => access_token)
end