Sha256: 30d916e0b2f8028f5ea3a72ba98fb8a879513081bd3e53b7690d855a206c1e07
Contents?: true
Size: 935 Bytes
Versions: 20
Compression:
Stored size: 935 Bytes
Contents
module FBGraph class Realtime < Base def initialize(client) @objects = 'subscriptions' super(client) end OBJECTS = %w(user permissions errors).freeze OBJECTS.each do |object| class_eval <<-METHOD def #{object} @params[:object] = "#{object}" self end METHOD end def fields(fs = "email,picture") @params[:fields] = fs self end def callback_url(url) @params[:callback_url] = url self end def veryfy_token(token) @params[:veryfy_token] = token self end alias_method :subscribe! , :publish! private def build_open_graph_path(objects,connection_type = nil , params = {}) request = "/" + [objects , connection_type].compact.join('/') request += "?"+params.to_a.map{|p| p.join('=')}.join('&') unless params.empty? request end end end
Version data entries
20 entries across 20 versions & 1 rubygems