Module: GSGraph

Defined in:
lib/gs_graph.rb,
lib/gs_graph/doc.rb,
lib/gs_graph/tab.rb,
lib/gs_graph/tag.rb,
lib/gs_graph/auth.rb,
lib/gs_graph/link.rb,
lib/gs_graph/node.rb,
lib/gs_graph/note.rb,
lib/gs_graph/page.rb,
lib/gs_graph/poke.rb,
lib/gs_graph/post.rb,
lib/gs_graph/role.rb,
lib/gs_graph/user.rb,
lib/gs_graph/work.rb,
lib/gs_graph/album.rb,
lib/gs_graph/cover.rb,
lib/gs_graph/event.rb,
lib/gs_graph/group.rb,
lib/gs_graph/image.rb,
lib/gs_graph/klass.rb,
lib/gs_graph/offer.rb,
lib/gs_graph/order.rb,
lib/gs_graph/photo.rb,
lib/gs_graph/place.rb,
lib/gs_graph/query.rb,
lib/gs_graph/score.rb,
lib/gs_graph/venue.rb,
lib/gs_graph/video.rb,
lib/gs_graph/action.rb,
lib/gs_graph/device.rb,
lib/gs_graph/domain.rb,
lib/gs_graph/status.rb,
lib/gs_graph/thread.rb,
lib/gs_graph/ad_user.rb,
lib/gs_graph/checkin.rb,
lib/gs_graph/comment.rb,
lib/gs_graph/insight.rb,
lib/gs_graph/message.rb,
lib/gs_graph/picture.rb,
lib/gs_graph/privacy.rb,
lib/gs_graph/project.rb,
lib/gs_graph/ad_group.rb,
lib/gs_graph/debugger.rb,
lib/gs_graph/location.rb,
lib/gs_graph/property.rb,
lib/gs_graph/question.rb,
lib/gs_graph/age_range.rb,
lib/gs_graph/education.rb,
lib/gs_graph/exception.rb,
lib/gs_graph/milestone.rb,
lib/gs_graph/targeting.rb,
lib/gs_graph/test_user.rb,
lib/gs_graph/ad_account.rb,
lib/gs_graph/ad_keyword.rb,
lib/gs_graph/ad_preview.rb,
lib/gs_graph/collection.rb,
lib/gs_graph/comparison.rb,
lib/gs_graph/connection.rb,
lib/gs_graph/searchable.rb,
lib/gs_graph/achievement.rb,
lib/gs_graph/ad_campaign.rb,
lib/gs_graph/ad_creative.rb,
lib/gs_graph/app_request.rb,
lib/gs_graph/application.rb,
lib/gs_graph/auth/cookie.rb,
lib/gs_graph/friend_list.rb,
lib/gs_graph/notification.rb,
lib/gs_graph/subscription.rb,
lib/gs_graph/ad_group_stat.rb,
lib/gs_graph/serialization.rb,
lib/gs_graph/tagged_object.rb,
lib/gs_graph/friend_request.rb,
lib/gs_graph/reach_estimate.rb,
lib/gs_graph/promotable_post.rb,
lib/gs_graph/question_option.rb,
lib/gs_graph/ad_campaign_stat.rb,
lib/gs_graph/ad_keyword_valid.rb,
lib/gs_graph/connections/docs.rb,
lib/gs_graph/connections/feed.rb,
lib/gs_graph/connections/home.rb,
lib/gs_graph/connections/tabs.rb,
lib/gs_graph/connections/tags.rb,
lib/gs_graph/user_achievement.rb,
lib/gs_graph/connections/books.rb,
lib/gs_graph/connections/games.rb,
lib/gs_graph/connections/inbox.rb,
lib/gs_graph/connections/likes.rb,
lib/gs_graph/connections/links.rb,
lib/gs_graph/connections/maybe.rb,
lib/gs_graph/connections/music.rb,
lib/gs_graph/connections/notes.rb,
lib/gs_graph/connections/pokes.rb,
lib/gs_graph/connections/posts.rb,
lib/gs_graph/connections/roles.rb,
lib/gs_graph/connections/votes.rb,
lib/gs_graph/open_graph/action.rb,
lib/gs_graph/open_graph/object.rb,
lib/gs_graph/searchable/result.rb,
lib/gs_graph/connections/admins.rb,
lib/gs_graph/connections/albums.rb,
lib/gs_graph/connections/banned.rb,
lib/gs_graph/connections/events.rb,
lib/gs_graph/connections/family.rb,
lib/gs_graph/connections/groups.rb,
lib/gs_graph/connections/movies.rb,
lib/gs_graph/connections/offers.rb,
lib/gs_graph/connections/outbox.rb,
lib/gs_graph/connections/photos.rb,
lib/gs_graph/connections/scores.rb,
lib/gs_graph/connections/tagged.rb,
lib/gs_graph/connections/videos.rb,
lib/gs_graph/auth/signed_request.rb,
lib/gs_graph/connections/blocked.rb,
lib/gs_graph/connections/friends.rb,
lib/gs_graph/connections/invited.rb,
lib/gs_graph/connections/members.rb,
lib/gs_graph/connections/noreply.rb,
lib/gs_graph/connections/picture.rb,
lib/gs_graph/connections/senders.rb,
lib/gs_graph/connections/threads.rb,
lib/gs_graph/ad_connection_object.rb,
lib/gs_graph/connections/accounts.rb,
lib/gs_graph/connections/checkins.rb,
lib/gs_graph/connections/comments.rb,
lib/gs_graph/connections/declined.rb,
lib/gs_graph/connections/insights.rb,
lib/gs_graph/connections/messages.rb,
lib/gs_graph/connections/payments.rb,
lib/gs_graph/connections/settings.rb,
lib/gs_graph/connections/statuses.rb,
lib/gs_graph/ad_keyword_suggestion.rb,
lib/gs_graph/connections/ad_groups.rb,
lib/gs_graph/connections/attending.rb,
lib/gs_graph/connections/interests.rb,
lib/gs_graph/connections/questions.rb,
lib/gs_graph/connections/activities.rb,
lib/gs_graph/connections/milestones.rb,
lib/gs_graph/connections/television.rb,
lib/gs_graph/connections/test_users.rb,
lib/gs_graph/connections/user_likes.rb,
lib/gs_graph/connections/ad_accounts.rb,
lib/gs_graph/connections/ad_previews.rb,
lib/gs_graph/connections/permissions.rb,
lib/gs_graph/connections/subscribers.rb,
lib/gs_graph/open_graph/user_context.rb,
lib/gs_graph/broad_targeting_category.rb,
lib/gs_graph/connections/achievements.rb,
lib/gs_graph/connections/ad_campaigns.rb,
lib/gs_graph/connections/ad_creatives.rb,
lib/gs_graph/connections/app_requests.rb,
lib/gs_graph/connections/friend_lists.rb,
lib/gs_graph/connections/participants.rb,
lib/gs_graph/page/category_attributes.rb,
lib/gs_graph/connections/conversations.rb,
lib/gs_graph/connections/notifications.rb,
lib/gs_graph/connections/subscribed_to.rb,
lib/gs_graph/connections/subscriptions.rb,
lib/gs_graph/connections/ad_group_stats.rb,
lib/gs_graph/connections/mutual_friends.rb,
lib/gs_graph/connections/friend_requests.rb,
lib/gs_graph/connections/reach_estimates.rb,
lib/gs_graph/connections/promotable_posts.rb,
lib/gs_graph/connections/question_options.rb,
lib/gs_graph/connections/ad_campaign_stats.rb,
lib/gs_graph/connections/app_notifications.rb,
lib/gs_graph/connections/user_achievements.rb,
lib/gs_graph/open_graph/application_context.rb,
lib/gs_graph/connections/former_participants.rb,
lib/gs_graph/connections/ad_connection_objects.rb,
lib/gs_graph/connections/broad_targeting_categories.rb

Defined Under Namespace

Modules: Comparison, Connections, Debugger, OpenGraph, Searchable, Serialization Classes: Achievement, Action, AdAccount, AdCampaign, AdCampaignStat, AdConnectionObject, AdCreative, AdGroup, AdGroupStat, AdKeyword, AdKeywordSuggestion, AdKeywordValid, AdPreview, AdUser, AdgroupFetchFailure, AgeRange, Album, AppRequest, Application, Auth, BadRequest, BroadTargetingCategory, Checkin, Collection, Comment, Connection, Cover, CreativeNotSaved, Device, Doc, Domain, Education, Event, Exception, FriendList, FriendRequest, Group, Image, Insight, InternalServerError, InvalidRequest, InvalidSession, InvalidToken, Klass, Link, Location, Message, Milestone, Node, NotFound, Note, Notification, Offer, OpenProcessFailure, Order, Page, Photo, Picture, Place, Poke, Post, Privacy, Project, PromotablePost, Property, Query, QueryConnection, QueryDuplicateKey, QueryError, QueryLockTimeout, Question, QuestionOption, ReachEstimate, Role, Score, Status, Subscription, Tab, Tag, TaggedObject, Targeting, TargetingSpecNotSaved, TestUser, Thread, TransactionCommitFailure, Unauthorized, User, UserAchievement, Venue, Video, Work

Constant Summary collapse

VERSION =
::File.read(
  ::File.join(::File.dirname(__FILE__), '../VERSION')
).delete("\n\r")
@@graph =
"https://graph.gamestamper.com"
@@www =
"http://www.gamestamper.com"

Class Method Summary collapse

Class Method Details

.debug(&block) ⇒ Object



60
61
62
63
64
65
66
67
68
# File 'lib/gs_graph.rb', line 60

def self.debug(&block)
  rack_oauth2_original = Rack::OAuth2.debugging?
  original = self.debugging?
  debug!
  yield
ensure
  Rack::OAuth2.debugging = rack_oauth2_original
  self.debugging = original
end

.debug!Object



56
57
58
59
# File 'lib/gs_graph.rb', line 56

def self.debug!
  Rack::OAuth2.debug!
  self.debugging = true
end

.debugging=(boolean) ⇒ Object



52
53
54
55
# File 'lib/gs_graph.rb', line 52

def self.debugging=(boolean)
  Rack::OAuth2.debugging = boolean
  @@debugging = boolean
end

.debugging?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/gs_graph.rb', line 49

def self.debugging?
  @@debugging
end

.graph_urlObject



32
33
34
# File 'lib/gs_graph.rb', line 32

def self.graph_url
	return @@graph
end

.http_clientObject



71
72
73
74
75
76
77
78
# File 'lib/gs_graph.rb', line 71

def self.http_client
  _http_client_ = HTTPClient.new(
    :agent_name => "GSGraph (#{VERSION})"
  )
  _http_client_.request_filter << Debugger::RequestFilter.new if debugging?
  http_config.try(:call, _http_client_)
  _http_client_
end

.http_config(&block) ⇒ Object



79
80
81
82
# File 'lib/gs_graph.rb', line 79

def self.http_config(&block)
  Rack::OAuth2.http_config &block unless Rack::OAuth2.http_config
  @@http_config ||= block
end

.loggerObject



40
41
42
# File 'lib/gs_graph.rb', line 40

def self.logger
  @@logger
end

.logger=(logger) ⇒ Object



43
44
45
# File 'lib/gs_graph.rb', line 43

def self.logger=(logger)
  @@logger = logger
end

.setup(session, request) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/gs_graph.rb', line 14

def self.setup(session, request)
	if (!request[:gsgraph].blank?)
		session[:gsgraph] = request[:gsgraph]
	end
	
	if (!request[:gswww].blank?)
		session[:gswww] = request[:gswww]
	end
	
	if (!session[:gsgraph].blank?)
		@@graph = session[:gsgraph]
	end
	
	if (!session[:gswww].blank?)
		@@www = session[:gswww]
	end
end

.www_urlObject



36
37
38
# File 'lib/gs_graph.rb', line 36

def self.www_url
	return @@www
end