Class: Stacked::Comment

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

association, collection, find, #initialize, #parse_answers, #parse_badges, #parse_comments, #parse_post_timeline, #parse_questions, #parse_reputations, #parse_tags, #parse_type, #parse_user_timeline, #post, records, request, singular, stats

Constructor Details

This class inherits a constructor from Stacked::Base

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



3
4
5
# File 'lib/stacked/comment.rb', line 3

def body
  @body
end

#comment_idObject Also known as: id

Returns the value of attribute comment_id.



3
4
5
# File 'lib/stacked/comment.rb', line 3

def comment_id
  @comment_id
end

#creation_dateObject Also known as: created_at

Returns the value of attribute creation_date.



3
4
5
# File 'lib/stacked/comment.rb', line 3

def creation_date
  @creation_date
end

#edit_countObject Also known as: edits

Returns the value of attribute edit_count.



3
4
5
# File 'lib/stacked/comment.rb', line 3

def edit_count
  @edit_count
end

#owner_display_nameObject

Returns the value of attribute owner_display_name.



3
4
5
# File 'lib/stacked/comment.rb', line 3

def owner_display_name
  @owner_display_name
end

#owner_user_idObject

Returns the value of attribute owner_user_id.



3
4
5
# File 'lib/stacked/comment.rb', line 3

def owner_user_id
  @owner_user_id
end

#post_idObject

Returns the value of attribute post_id.



3
4
5
# File 'lib/stacked/comment.rb', line 3

def post_id
  @post_id
end

#post_typeObject

Returns the value of attribute post_type.



3
4
5
# File 'lib/stacked/comment.rb', line 3

def post_type
  @post_type
end

#reply_to_user_idObject

Returns the value of attribute reply_to_user_id.



3
4
5
# File 'lib/stacked/comment.rb', line 3

def reply_to_user_id
  @reply_to_user_id
end

#scoreObject

Returns the value of attribute score.



3
4
5
# File 'lib/stacked/comment.rb', line 3

def score
  @score
end

Class Method Details

.all(*args) ⇒ Object



15
16
17
# File 'lib/stacked/comment.rb', line 15

def all(*args)
  raise Stacked::NotImplemented
end

Instance Method Details

#ownerObject Also known as: user

The owner of this comment.



27
28
29
# File 'lib/stacked/comment.rb', line 27

def owner
  @owner ||= Stacked::User.find(owner_user_id)
end

#reply_toObject

Finds the user this comment was in reply to. nil if no user.



22
23
24
# File 'lib/stacked/comment.rb', line 22

def reply_to
  Stacked::User.find(reply_to_user_id) if reply_to_user_id
end