class Databasedotcom::Chatter::FeedItem

An item in a Feed.

Protected Class Methods

collection_from_response(response) click to toggle source
# File lib/databasedotcom/chatter/feed_item.rb, line 35
def self.collection_from_response(response)
  response["items"]
end

Public Instance Methods

comment(text) click to toggle source

Post a Comment on this FeedItem with content text.

# File lib/databasedotcom/chatter/feed_item.rb, line 28
def comment(text)
  result = self.client.http_post("/services/data/v#{self.client.version}/chatter/feed-items/#{self.id}/comments", nil, :text => text)
  Comment.new(self.client, result.body)
end
comments() click to toggle source

Returns a Collection of comments that were posted on this FeedItem instance.

# File lib/databasedotcom/chatter/feed_item.rb, line 10
def comments
  collection = Databasedotcom::Collection.new(self.client, self.raw_hash["comments"]["total"], self.raw_hash["comments"]["nextPageUrl"], nil, self.raw_hash["comments"]["currentPageUrl"])
  collection.concat(self.raw_hash["comments"]["comments"])
end
like() click to toggle source

Like this FeedItem.

# File lib/databasedotcom/chatter/feed_item.rb, line 22
def like
  result = self.client.http_post("/services/data/v#{self.client.version}/chatter/feed-items/#{self.id}/likes")
  Like.new(self.client, result.body)
end
likes() click to toggle source

Returns a Collection of likes for this FeedItem instance.

# File lib/databasedotcom/chatter/feed_item.rb, line 16
def likes
  collection = Databasedotcom::Collection.new(self.client, self.raw_hash["likes"]["total"], self.raw_hash["likes"]["nextPageUrl"], self.raw_hash["likes"]["previousPageUrl"], self.raw_hash["likes"]["currentPageUrl"])
  collection.concat(self.raw_hash["likes"]["likes"])
end