mirror of
				https://github.com/nov/fb_graph2
				synced 2023-03-27 23:22:15 -04:00 
			
		
		
		
	family & friendlists
This commit is contained in:
		
							parent
							
								
									0349beb157
								
							
						
					
					
						commit
						c3c8798893
					
				
					 4 changed files with 37 additions and 1 deletions
				
			
		
							
								
								
									
										12
									
								
								lib/fb_graph2/edge/family.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								lib/fb_graph2/edge/family.rb
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,12 @@
 | 
			
		|||
module FbGraph2
 | 
			
		||||
  class Edge
 | 
			
		||||
    module Family
 | 
			
		||||
      def family(params = {})
 | 
			
		||||
        users = self.edge :family, params
 | 
			
		||||
        users.collect do |user|
 | 
			
		||||
          User.new(user[:id], user).authenticate self.access_token
 | 
			
		||||
        end
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
							
								
								
									
										13
									
								
								lib/fb_graph2/edge/friend_lists.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								lib/fb_graph2/edge/friend_lists.rb
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,13 @@
 | 
			
		|||
module FbGraph2
 | 
			
		||||
  class Edge
 | 
			
		||||
    module FriendLists
 | 
			
		||||
      def friend_lists(params = {})
 | 
			
		||||
        friend_lists = self.edge :friendlists, params
 | 
			
		||||
        friend_lists.collect do |friend_list|
 | 
			
		||||
          FriendList.new(friend_list[:id], friend_list).authenticate self.access_token
 | 
			
		||||
        end
 | 
			
		||||
      end
 | 
			
		||||
      alias_method :friendlists, :friend_lists
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
							
								
								
									
										7
									
								
								lib/fb_graph2/friend_list.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								lib/fb_graph2/friend_list.rb
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
module FbGraph2
 | 
			
		||||
  class FriendList < Node
 | 
			
		||||
    register_attributes(
 | 
			
		||||
      raw: [:name, :list_type]
 | 
			
		||||
    )
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			@ -6,7 +6,9 @@ module FbGraph2
 | 
			
		|||
    include Edge::Albums
 | 
			
		||||
    include Edge::Books
 | 
			
		||||
    include Edge::Events
 | 
			
		||||
    include Edge::Family
 | 
			
		||||
    include Edge::Feed
 | 
			
		||||
    include Edge::FriendLists
 | 
			
		||||
    include Edge::Friends
 | 
			
		||||
    include Edge::Games
 | 
			
		||||
    include Edge::Home
 | 
			
		||||
| 
						 | 
				
			
			@ -24,7 +26,9 @@ module FbGraph2
 | 
			
		|||
      raw: [
 | 
			
		||||
        :about, :bio, :email, :first_name, :gender, :installed, :is_verified, :link, :locale,
 | 
			
		||||
        :middle_name, :name, :name_format, :political, :quotes, :relationship_status, :religion,
 | 
			
		||||
        :timezone, :third_party_id, :verified, :website
 | 
			
		||||
        :timezone, :third_party_id, :verified, :website,
 | 
			
		||||
        # NOTE: in family edge context
 | 
			
		||||
        :relationship
 | 
			
		||||
      ],
 | 
			
		||||
      time: [:updated_time], # NOTE: undocumented attribute
 | 
			
		||||
      date: [:birthday],
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue