Class: FbGraph2::User

Direct Known Subclasses

TestUser

Instance Attribute Summary

Attributes inherited from Node

#access_token, #id

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Searchable

search, search

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

#score!, #scores, #unscore!

Methods included from Edge::Posts

#posts

Methods included from Edge::Pokes

#pokes

Methods included from Edge::Photos

#photo!, #photos

Methods included from Edge::Picture

#assign, #picture

Methods included from Edge::Permissions

#permissions, #revoke!

Methods included from Edge::PaymentTransactions

#payment_transactions

Methods included from Edge::Music

#music

Methods included from Edge::Movies

#movies

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

#domains

Methods included from Edge::Books

#books

Methods included from Edge::AppRequests

#app_request!, #app_requests

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, #update

Methods included from AttributeAssigner

#assign

Constructor Details

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

Returns a new instance of User.



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

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



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

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