mirror of
				https://github.com/nov/fb_graph2
				synced 2023-03-27 23:22:15 -04:00 
			
		
		
		
	groups
This commit is contained in:
		
							parent
							
								
									c3c8798893
								
							
						
					
					
						commit
						9ecdb091d3
					
				
					 3 changed files with 31 additions and 1 deletions
				
			
		
							
								
								
									
										12
									
								
								lib/fb_graph2/edge/groups.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								lib/fb_graph2/edge/groups.rb
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,12 @@
 | 
			
		|||
module FbGraph2
 | 
			
		||||
  class Edge
 | 
			
		||||
    module Groups
 | 
			
		||||
      def groups(params = {})
 | 
			
		||||
        groups = self.edge :groups, params
 | 
			
		||||
        groups.collect do |group|
 | 
			
		||||
          Group.new(group[:id], group).authenticate self.access_token
 | 
			
		||||
        end
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
							
								
								
									
										18
									
								
								lib/fb_graph2/group.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								lib/fb_graph2/group.rb
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,18 @@
 | 
			
		|||
module FbGraph2
 | 
			
		||||
  class Group < Node
 | 
			
		||||
    register_attributes(
 | 
			
		||||
      raw: [
 | 
			
		||||
        :description, :email, :icon, :link, :name, :privacy,
 | 
			
		||||
        # NOTE: in groups edge context
 | 
			
		||||
        :administrator, :bookmark_order, :unread
 | 
			
		||||
      ],
 | 
			
		||||
      time: [:updated_time],
 | 
			
		||||
      custom: [:cover, :owner, :parent]
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    def initialize(id, attributes = {})
 | 
			
		||||
      super
 | 
			
		||||
      # TODO: handle custom attributes.
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			@ -6,7 +6,7 @@ module FbGraph2
 | 
			
		|||
        :current_location, :description, :directed_by, :founded, :general_info, :general_manager, :hometown,
 | 
			
		||||
        :is_permanently_closed, :is_published, :is_unclaimed, :likes, :link, :mission, :name, :phone, :press_contact,
 | 
			
		||||
        :products, :talking_about_count, :username, :website, :were_here_count,
 | 
			
		||||
        # only within /:user_id/accounts context
 | 
			
		||||
        # NOTE: only within /:user_id/accounts context
 | 
			
		||||
        :perms
 | 
			
		||||
      ],
 | 
			
		||||
      time: [:created_time],
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue