Module: FbGraph2::Edge::Likes::LikeeContext
- Defined in:
- lib/fb_graph2/edge/likes.rb
Instance Method Summary collapse
- #assign(attributes) ⇒ Object
- #like!(params = {}) ⇒ Object
- #likes(params = {}) ⇒ Object
- #unlike!(params = {}) ⇒ Object
Instance Method Details
#assign(attributes) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/fb_graph2/edge/likes.rb', line 19 def assign(attributes) super if attributes.include? :likes @_cached_likes = Collection.new attributes[:likes] end end |
#like!(params = {}) ⇒ Object
37 38 39 |
# File 'lib/fb_graph2/edge/likes.rb', line 37 def like!(params = {}) self.post params, edge: :likes end |
#likes(params = {}) ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/fb_graph2/edge/likes.rb', line 26 def likes(params = {}) users = if @_cached_likes.present? && params.blank? @_cached_likes else self.edge :likes, params end users.collect! do |user| User.new(user[:id], user).authenticate self.access_token end end |
#unlike!(params = {}) ⇒ Object
41 42 43 |
# File 'lib/fb_graph2/edge/likes.rb', line 41 def unlike!(params = {}) self.delete params, edge: :likes end |