Class: Rubyoverflow::Comment
- Inherits:
-
Object
- Object
- Rubyoverflow::Comment
- Defined in:
- lib/rubyoverflow/comment.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#comment_id ⇒ Object
readonly
Returns the value of attribute comment_id.
-
#creation_date ⇒ Object
readonly
Returns the value of attribute creation_date.
-
#edit_count ⇒ Object
readonly
Returns the value of attribute edit_count.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#post_id ⇒ Object
readonly
Returns the value of attribute post_id.
-
#post_type ⇒ Object
readonly
Returns the value of attribute post_type.
-
#reply_to_user ⇒ Object
readonly
Returns the value of attribute reply_to_user.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
Instance Method Summary collapse
-
#initialize(hash, request_path = '') ⇒ Comment
constructor
A new instance of Comment.
Constructor Details
#initialize(hash, request_path = '') ⇒ Comment
Returns a new instance of Comment.
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rubyoverflow/comment.rb', line 14 def initialize(hash, request_path = '') dash = CommentDash.new hash @comment_id = dash.comment_id @creation_date = dash.creation_date @owner = User.new dash.owner @reply_to_user = User.new dash.reply_to_user if dash.reply_to_user @post_id = dash.post_id @post_type = dash.post_type @score = dash.score @edit_count = dash.edit_count @body = dash.body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
12 13 14 |
# File 'lib/rubyoverflow/comment.rb', line 12 def body @body end |
#comment_id ⇒ Object (readonly)
Returns the value of attribute comment_id.
4 5 6 |
# File 'lib/rubyoverflow/comment.rb', line 4 def comment_id @comment_id end |
#creation_date ⇒ Object (readonly)
Returns the value of attribute creation_date.
5 6 7 |
# File 'lib/rubyoverflow/comment.rb', line 5 def creation_date @creation_date end |
#edit_count ⇒ Object (readonly)
Returns the value of attribute edit_count.
11 12 13 |
# File 'lib/rubyoverflow/comment.rb', line 11 def edit_count @edit_count end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
6 7 8 |
# File 'lib/rubyoverflow/comment.rb', line 6 def owner @owner end |
#post_id ⇒ Object (readonly)
Returns the value of attribute post_id.
8 9 10 |
# File 'lib/rubyoverflow/comment.rb', line 8 def post_id @post_id end |
#post_type ⇒ Object (readonly)
Returns the value of attribute post_type.
9 10 11 |
# File 'lib/rubyoverflow/comment.rb', line 9 def post_type @post_type end |
#reply_to_user ⇒ Object (readonly)
Returns the value of attribute reply_to_user.
7 8 9 |
# File 'lib/rubyoverflow/comment.rb', line 7 def reply_to_user @reply_to_user end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
10 11 12 |
# File 'lib/rubyoverflow/comment.rb', line 10 def score @score end |