Sha256: a0c621b20f723debf74c841c02e0fcfc1c5ad5fa07358cd2f927dfff9cdc40d0

Contents?: true

Size: 1.56 KB

Versions: 4

Compression:

Stored size: 1.56 KB

Contents

module FBGraph
  class Selection < Base
    
    OBJECTS = %w(user album event group link note page photo post status 
                 video comment checkin friendlist thread order application
                 apprequest).freeze
   
    CONNECTION_TYPES = %w(home photos comments feed	noreply	
                          maybe invited attending declined picture 
                          members tagged links groups albums	
                          statuses	videos notes posts events friends	
                          activities interests music books movies television	
                          likes inbox outbox updates accounts checkins 
                          friendlists platformrequests threads participants 
                          former_participants senders messages insights 
                          subscriptions payments apprequests).freeze
   
    OBJECTS.each do |object|
      class_eval  <<-METHOD
        def #{object}(object)
          find(object)
          self
        end
     METHOD
    end
   
    CONNECTION_TYPES.each do |object|
      class_eval  <<-METHOD
        def #{object}
          connection('#{object}')
          self
        end
      METHOD
    end


    def me
      find('me')
    end
   
    def metadata
      @params.merge!({:metadata => '1'})
      self
    end   

    def picture(type='square')
      params = {:type => type}
      params.merge!(:access_token => @client.access_token) unless @client.access_token.blank?
      uri = [@client.facebook_uri , build_open_graph_path(@objects , 'picture' , params)].join('/')
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fbgraph-1.8.4 lib/fbgraph/selection.rb
fbgraph-1.8.3 lib/fbgraph/selection.rb
fbgraph-1.8.0 lib/fbgraph/selection.rb
fbgraph-1.7.1 lib/fbgraph/selection.rb