Class: FbGraph2::User

Instance Attribute Summary

Attributes inherited from Node

#access_token, #id, #raw_attributes

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Edge::Videos

#video!, #videos

Methods included from Edge::Television

#television

Methods included from Edge::TaggedPlaces

#tagged_places

Methods included from Edge::Tagged

#tagged

Methods included from Edge::TaggableFriends

#taggable_friends

Methods included from Edge::Statuses

#statuses

Methods included from Edge::Scores

#scores

Methods included from Edge::Posts

#posts

Methods included from Edge::Pokes

#pokes

Methods included from Edge::Photos

#photo!, #photos

Methods included from Edge::Picture

#picture

Methods included from Edge::Permissions

#permissions

Methods included from Edge::PaymentTransactions

#payment_transactions

Methods included from Edge::Outbox

#outbox

Methods included from Edge::Notifications

#notification!, #notifications

Methods included from Edge::Music

#music

Methods included from Edge::Movies

#movies

Methods included from Edge::Links

#links

Methods included from Edge::Likes::LikerContext

#liked?, #likes

Methods included from Edge::InvitableFriends

#invitable_friends

Methods included from Edge::Interests

#interests

Methods included from Edge::Inbox

#inbox

Methods included from Edge::Home

#home

Methods included from Edge::Groups

#groups

Methods included from Edge::Games

#games

Methods included from Edge::Friends

#friend?, #friends

Methods included from Edge::FriendLists

#friend_lists

Methods included from Edge::Feed

#feed, #feed!

Methods included from Edge::Family

#family

Methods included from Edge::Events

#events

Methods included from Edge::Books

#books

Methods included from Edge::AppRequests

#app_request!, #app_requests

Methods included from Edge::Applications

#applications

Methods included from Edge::Albums

#album!, #albums

Methods included from Edge::Activities

#activities

Methods included from Edge::Achievements

#achievements

Methods included from Edge::Accounts

#accounts

Methods inherited from Node

#authenticate, #destroy, #edge, #edges, fetch, #fetch, inherited, #update

Constructor Details

#initialize(id, attributes = {}) ⇒ User



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
# File 'lib/fb_graph2/user.rb', line 73

def initialize(id, attributes = {})
  super
  if attributes.include? :age_range
    self.age_range = Struct::AgeRange.new attributes[:age_range]
  end
  if attributes.include? :context
    self.context = Struct::Context::UserContext.new attributes[:context]
  end
  if attributes.include? :currency
    self.currency = Struct::Currency.new attributes[:currency]
  end
  if attributes.include? :devices
    self.devices = attributes[:devices].collect do |device|
      Struct::Device.new device
    end
  end
  if attributes.include? :education
    self.education = attributes[:education].collect do |education|
      Struct::Education.new education
    end
  end
  if attributes.include? :work
    self.work = attributes[:work].collect do |work|
      Struct::Work.new work
    end
  end
end

Class Method Details

.me(access_token) ⇒ Object



101
102
103
# File 'lib/fb_graph2/user.rb', line 101

def self.me(access_token)
  new(:me).authenticate access_token
end