Class: Biostars::API::Post
- Inherits:
-
Object
- Object
- Biostars::API::Post
- Defined in:
- lib/biostars/api/post.rb
Overview
General info about a post.
Instance Attribute Summary collapse
-
#answer_count ⇒ Fixnum
readonly
Number of answers.
-
#author ⇒ String
readonly
Author name.
-
#author_id ⇒ Fixnum
readonly
Author’s identifier, a number.
-
#book_count ⇒ Fixnum
readonly
Number of bookmarks.
-
#comment_count ⇒ Fixnum
readonly
Number of comments.
-
#creation_date ⇒ String
readonly
Creation date, ISO 8601 format.
-
#has_accepted ⇒ Boolean
readonly
True if the question has an accepted answer, boolean.
-
#id ⇒ Fixnum
readonly
Identifier of the post, a number.
-
#lastedit_date ⇒ String
readonly
Date of last edit, ISO 8601 format.
-
#lastedit_user_id ⇒ Fixnum
readonly
User who last edited this post.
-
#parent_id ⇒ Fixnum
readonly
Identifier of the parent post.
-
#rank ⇒ Fixnum
readonly
Rank, a number.
-
#reply_count ⇒ Fixnum
readonly
Number of replies.
-
#root_id ⇒ Fixnum
readonly
Identifier of the root post.
-
#status ⇒ String
readonly
Status message.
-
#status_id ⇒ Fixnum
readonly
Status’ identifier, a number.
-
#subs_count ⇒ Fixnum
readonly
Number of subscribers following this post.
-
#tag_val ⇒ String
readonly
Tags.
-
#thread_score ⇒ Fixnum
readonly
Thread’s score.
-
#title ⇒ String
readonly
Title.
-
#type ⇒ String
readonly
Type of post.
-
#type_id ⇒ Fixnum
readonly
Type’s identifier for this post.
-
#url ⇒ String
readonly
Url.
-
#view_count ⇒ Fixnum
readonly
Number of views.
-
#vote_count ⇒ Fixnum
readonly
Number of votes.
-
#xhtml ⇒ String
readonly
Content.
Class Method Summary collapse
-
.find(id) ⇒ Post
Finds post with the given id.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Post
constructor
Instantiate the Biostars::API::Post.
Constructor Details
#initialize(attributes) ⇒ Post
Instantiate the Biostars::API::Post.
87 88 89 90 91 |
# 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 |
Instance Attribute Details
#answer_count ⇒ Fixnum (readonly)
Returns number of answers.
9 10 11 |
# File 'lib/biostars/api/post.rb', line 9 def answer_count @answer_count end |
#author ⇒ String (readonly)
Returns author name.
12 13 14 |
# File 'lib/biostars/api/post.rb', line 12 def @author end |
#author_id ⇒ Fixnum (readonly)
Returns author’s identifier, a number.
15 16 17 |
# File 'lib/biostars/api/post.rb', line 15 def @author_id end |
#book_count ⇒ Fixnum (readonly)
Returns number of bookmarks.
18 19 20 |
# File 'lib/biostars/api/post.rb', line 18 def book_count @book_count end |
#comment_count ⇒ Fixnum (readonly)
Returns number of comments.
21 22 23 |
# File 'lib/biostars/api/post.rb', line 21 def comment_count @comment_count end |
#creation_date ⇒ String (readonly)
Returns creation date, ISO 8601 format.
24 25 26 |
# File 'lib/biostars/api/post.rb', line 24 def creation_date @creation_date end |
#has_accepted ⇒ Boolean (readonly)
Returns true if the question has an accepted answer, boolean.
27 28 29 |
# File 'lib/biostars/api/post.rb', line 27 def has_accepted @has_accepted end |
#id ⇒ Fixnum (readonly)
Returns identifier of the post, a number.
30 31 32 |
# File 'lib/biostars/api/post.rb', line 30 def id @id end |
#lastedit_date ⇒ String (readonly)
Returns date of last edit, ISO 8601 format.
33 34 35 |
# File 'lib/biostars/api/post.rb', line 33 def lastedit_date @lastedit_date end |
#lastedit_user_id ⇒ Fixnum (readonly)
Returns user who last edited this post.
36 37 38 |
# File 'lib/biostars/api/post.rb', line 36 def lastedit_user_id @lastedit_user_id end |
#parent_id ⇒ Fixnum (readonly)
Returns identifier of the parent post.
39 40 41 |
# File 'lib/biostars/api/post.rb', line 39 def parent_id @parent_id end |
#rank ⇒ Fixnum (readonly)
Returns rank, a number.
42 43 44 |
# File 'lib/biostars/api/post.rb', line 42 def rank @rank end |
#reply_count ⇒ Fixnum (readonly)
Returns number of replies.
45 46 47 |
# File 'lib/biostars/api/post.rb', line 45 def reply_count @reply_count end |
#root_id ⇒ Fixnum (readonly)
Returns identifier of the root post.
48 49 50 |
# File 'lib/biostars/api/post.rb', line 48 def root_id @root_id end |
#status ⇒ String (readonly)
Returns status message.
51 52 53 |
# File 'lib/biostars/api/post.rb', line 51 def status @status end |
#status_id ⇒ Fixnum (readonly)
Returns status’ identifier, a number.
54 55 56 |
# File 'lib/biostars/api/post.rb', line 54 def status_id @status_id end |
#subs_count ⇒ Fixnum (readonly)
Returns number of subscribers following this post.
57 58 59 |
# File 'lib/biostars/api/post.rb', line 57 def subs_count @subs_count end |
#tag_val ⇒ String (readonly)
Returns tags.
60 61 62 |
# File 'lib/biostars/api/post.rb', line 60 def tag_val @tag_val end |
#thread_score ⇒ Fixnum (readonly)
Returns thread’s score.
63 64 65 |
# File 'lib/biostars/api/post.rb', line 63 def thread_score @thread_score end |
#title ⇒ String (readonly)
Returns title.
66 67 68 |
# File 'lib/biostars/api/post.rb', line 66 def title @title end |
#type ⇒ String (readonly)
Returns type of post.
69 70 71 |
# File 'lib/biostars/api/post.rb', line 69 def type @type end |
#type_id ⇒ Fixnum (readonly)
Returns type’s identifier for this post.
72 73 74 |
# File 'lib/biostars/api/post.rb', line 72 def type_id @type_id end |
#url ⇒ String (readonly)
Returns url.
75 76 77 |
# File 'lib/biostars/api/post.rb', line 75 def url @url end |
#view_count ⇒ Fixnum (readonly)
Returns number of views.
78 79 80 |
# File 'lib/biostars/api/post.rb', line 78 def view_count @view_count end |
#vote_count ⇒ Fixnum (readonly)
Returns number of votes.
81 82 83 |
# File 'lib/biostars/api/post.rb', line 81 def vote_count @vote_count end |
#xhtml ⇒ String (readonly)
Returns content.
84 85 86 |
# File 'lib/biostars/api/post.rb', line 84 def xhtml @xhtml end |