Class: Rubyoverflow::Comment

Inherits:
Object
  • Object
show all
Defined in:
lib/rubyoverflow/comment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (readonly)

Returns the value of attribute body.



12
13
14
# File 'lib/rubyoverflow/comment.rb', line 12

def body
  @body
end

#comment_idObject (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_dateObject (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_countObject (readonly)

Returns the value of attribute edit_count.



11
12
13
# File 'lib/rubyoverflow/comment.rb', line 11

def edit_count
  @edit_count
end

#ownerObject (readonly)

Returns the value of attribute owner.



6
7
8
# File 'lib/rubyoverflow/comment.rb', line 6

def owner
  @owner
end

#post_idObject (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_typeObject (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_userObject (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

#scoreObject (readonly)

Returns the value of attribute score.



10
11
12
# File 'lib/rubyoverflow/comment.rb', line 10

def score
  @score
end