class Biostars::API::Post
General info about a post. @author Arian Amador <arian@arianamador.com>
Attributes
@return [Fixnum] number of answers.
@return [Fixnum] number of bookmarks.
@return [Fixnum] number of comments.
@return [String] creation date, ISO 8601 format.
@return [Boolean] true if the question has an accepted answer, boolean.
@return [Fixnum] identifier of the post, a number.
@return [String] date of last edit, ISO 8601 format.
@return [Fixnum] user who last edited this post.
@return [Fixnum] identifier of the parent post.
@return [Fixnum] rank, a number.
@return [Fixnum] number of replies.
@return [Fixnum] identifier of the root post.
@return [String] status message.
@return [Fixnum] status’ identifier, a number.
@return [Fixnum] number of subscribers following this post.
@return [String] tags.
@return [Fixnum] thread’s score.
@return [String] title.
@return [String] type of post.
@return [Fixnum] type’s identifier for this post.
@return [String] url.
@return [Fixnum] number of views.
@return [Fixnum] number of votes.
@return [String] content.
Public Class Methods
Finds post with the given id.
@param id [Fixnum] post id. @return [Post] returns Post
object. @raise [Biostars::PostError] if Post
is not found.
# File lib/biostars/api/post.rb, line 98 def self.find(id) attributes = Biostars::API.get "post/#{id}" attributes ? new(attributes) : raise(Biostars::PostError) end
Instantiate the Biostars::API::Post
.
# File lib/biostars/api/post.rb, line 87 def initialize(attributes) attributes.each do |k,v| instance_variable_set("@#{k}", v) unless v.nil? end end