Class: Stacked::Answer

Inherits:
Base
  • Object
show all
Defined in:
lib/stacked/answer.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

#acceptedObject

Returns the value of attribute accepted.



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

def accepted
  @accepted
end

#answer_idObject Also known as: id

Returns the value of attribute answer_id.



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

def answer_id
  @answer_id
end

#bodyObject

Returns the value of attribute body.



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

def body
  @body
end

#commentsObject

Returns the value of attribute comments.



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

def comments
  @comments
end

#community_ownedObject

Returns the value of attribute community_owned.



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

def community_owned
  @community_owned
end

#creation_dateObject Also known as: created_at

Returns the value of attribute creation_date.



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

def creation_date
  @creation_date
end

#down_vote_countObject

Returns the value of attribute down_vote_count.



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

def down_vote_count
  @down_vote_count
end

#last_edit_dateObject Also known as: updated_at

Returns the value of attribute last_edit_date.



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

def last_edit_date
  @last_edit_date
end

#owner_display_nameObject

Returns the value of attribute owner_display_name.



3
4
5
# File 'lib/stacked/answer.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/answer.rb', line 3

def owner_user_id
  @owner_user_id
end

#question_idObject

Returns the value of attribute question_id.



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

def question_id
  @question_id
end

#scoreObject

Returns the value of attribute score.



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

def score
  @score
end

#titleObject

Returns the value of attribute title.



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

def title
  @title
end

#up_vote_countObject Also known as: up_votes

Returns the value of attribute up_vote_count.



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

def up_vote_count
  @up_vote_count
end

#view_countObject Also known as: views

Returns the value of attribute view_count.



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

def view_count
  @view_count
end

Class Method Details

.all(*args) ⇒ Object



20
21
22
# File 'lib/stacked/answer.rb', line 20

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

Instance Method Details

#ownerObject Also known as: user

A Stacked::User object representing the owner of the answer.



26
27
28
# File 'lib/stacked/answer.rb', line 26

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

#questionObject

A Stacked::Question object representing the question the answer is in response to.



31
32
33
# File 'lib/stacked/answer.rb', line 31

def question
  @question ||= Question.find(question_id)
end