Class: FbGraph2::Edge
- Inherits:
-
Collection
- Object
- Array
- Collection
- FbGraph2::Edge
- Defined in:
- lib/fb_graph2/edge.rb,
lib/fb_graph2/edge/docs.rb,
lib/fb_graph2/edge/feed.rb,
lib/fb_graph2/edge/tags.rb,
lib/fb_graph2/edge/books.rb,
lib/fb_graph2/edge/files.rb,
lib/fb_graph2/edge/games.rb,
lib/fb_graph2/edge/likes.rb,
lib/fb_graph2/edge/maybe.rb,
lib/fb_graph2/edge/music.rb,
lib/fb_graph2/edge/pokes.rb,
lib/fb_graph2/edge/posts.rb,
lib/fb_graph2/edge/roles.rb,
lib/fb_graph2/edge/admins.rb,
lib/fb_graph2/edge/albums.rb,
lib/fb_graph2/edge/banned.rb,
lib/fb_graph2/edge/events.rb,
lib/fb_graph2/edge/family.rb,
lib/fb_graph2/edge/groups.rb,
lib/fb_graph2/edge/movies.rb,
lib/fb_graph2/edge/offers.rb,
lib/fb_graph2/edge/photos.rb,
lib/fb_graph2/edge/scores.rb,
lib/fb_graph2/edge/tagged.rb,
lib/fb_graph2/edge/videos.rb,
lib/fb_graph2/edge/blocked.rb,
lib/fb_graph2/edge/dispute.rb,
lib/fb_graph2/edge/domains.rb,
lib/fb_graph2/edge/friends.rb,
lib/fb_graph2/edge/members.rb,
lib/fb_graph2/edge/noreply.rb,
lib/fb_graph2/edge/picture.rb,
lib/fb_graph2/edge/ratings.rb,
lib/fb_graph2/edge/refunds.rb,
lib/fb_graph2/edge/accounts.rb,
lib/fb_graph2/edge/comments.rb,
lib/fb_graph2/edge/declined.rb,
lib/fb_graph2/edge/insights.rb,
lib/fb_graph2/edge/messages.rb,
lib/fb_graph2/edge/send_api.rb,
lib/fb_graph2/edge/settings.rb,
lib/fb_graph2/edge/attending.rb,
lib/fb_graph2/edge/interests.rb,
lib/fb_graph2/edge/locations.rb,
lib/fb_graph2/edge/activities.rb,
lib/fb_graph2/edge/milestones.rb,
lib/fb_graph2/edge/television.rb,
lib/fb_graph2/edge/test_users.rb,
lib/fb_graph2/edge/permissions.rb,
lib/fb_graph2/edge/achievements.rb,
lib/fb_graph2/edge/app_insights.rb,
lib/fb_graph2/edge/app_requests.rb,
lib/fb_graph2/edge/friend_lists.rb,
lib/fb_graph2/edge/shared_posts.rb,
lib/fb_graph2/edge/translations.rb,
lib/fb_graph2/edge/conversations.rb,
lib/fb_graph2/edge/subscriptions.rb,
lib/fb_graph2/edge/tagged_places.rb,
lib/fb_graph2/edge/app_link_hosts.rb,
lib/fb_graph2/edge/app_event_types.rb,
lib/fb_graph2/edge/promotable_posts.rb,
lib/fb_graph2/edge/static_resources.rb,
lib/fb_graph2/edge/taggable_friends.rb,
lib/fb_graph2/edge/invitable_friends.rb,
lib/fb_graph2/edge/payment_transactions.rb,
lib/fb_graph2/edge/global_brand_children.rb
Defined Under Namespace
Modules: Accounts, Achievements, Activities, Admins, Albums, AppEventTypes, AppInsights, AppLinkHosts, AppRequests, Attending, Banned, Blocked, Books, Comments, Conversations, Declined, Dispute, Docs, Domains, Events, Family, Feed, Files, FriendLists, Friends, Games, GlobalBrandChildren, Groups, Insights, Interests, InvitableFriends, Likes, Locations, Maybe, Members, Messages, Milestones, Movies, Music, Noreply, Offers, PaymentTransactions, Permissions, Photos, Picture, Pokes, Posts, PromotablePosts, Ratings, Refunds, Roles, Scores, SendApi, Settings, SharedPosts, StaticResources, Subscriptions, TaggableFriends, Tagged, TaggedPlaces, Tags, Television, TestUsers, Translations, Videos
Instance Attribute Summary collapse
-
#collection ⇒ Object
Returns the value of attribute collection.
-
#edge ⇒ Object
Returns the value of attribute edge.
-
#options ⇒ Object
Returns the value of attribute options.
-
#owner ⇒ Object
Returns the value of attribute owner.
-
#params ⇒ Object
Returns the value of attribute params.
Attributes inherited from Collection
#after, #before, #summary, #total_count
Instance Method Summary collapse
-
#initialize(owner, edge, params = {}, options = {}) ⇒ Edge
constructor
A new instance of Edge.
- #next(_options_ = {}) ⇒ Object
- #previous(_options_ = {}) ⇒ Object
Constructor Details
#initialize(owner, edge, params = {}, options = {}) ⇒ Edge
Returns a new instance of Edge.
6 7 8 9 10 11 12 13 |
# File 'lib/fb_graph2/edge.rb', line 6 def initialize(owner, edge, params = {}, = {}) self.owner = owner self.edge = edge self.params = params self. = self.collection = .delete(:collection) || Collection.new replace collection end |
Instance Attribute Details
#collection ⇒ Object
Returns the value of attribute collection.
3 4 5 |
# File 'lib/fb_graph2/edge.rb', line 3 def collection @collection end |
#edge ⇒ Object
Returns the value of attribute edge.
3 4 5 |
# File 'lib/fb_graph2/edge.rb', line 3 def edge @edge end |
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'lib/fb_graph2/edge.rb', line 3 def @options end |
#owner ⇒ Object
Returns the value of attribute owner.
3 4 5 |
# File 'lib/fb_graph2/edge.rb', line 3 def owner @owner end |
#params ⇒ Object
Returns the value of attribute params.
3 4 5 |
# File 'lib/fb_graph2/edge.rb', line 3 def params @params end |
Instance Method Details
#next(_options_ = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/fb_graph2/edge.rb', line 15 def next( = {}) if collection.next.present? owner.send edge, .merge(collection.next).merge() elsif collection.after.present? owner.send edge, .merge(after: collection.after).merge() else self.class.new owner, edge end end |
#previous(_options_ = {}) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/fb_graph2/edge.rb', line 25 def previous( = {}) if self.collection.previous.present? owner.send edge, .merge(collection.previous).merge() elsif collection.before.present? owner.send edge, .merge(before: collection.before).merge() else self.class.new owner, edge end end |