Class: SE::API::Question

Inherits:
Post
  • Object
show all
Defined in:
lib/se/api/types/question.rb

Instance Attribute Summary collapse

Attributes inherited from Post

#author, #body, #comments, #created_at, #id, #json, #last_editor, #link, #score, #title, #type, #updated_at

Instance Method Summary collapse

Constructor Details

#initialize(item_json) ⇒ Question

Returns a new instance of Question.



8
9
10
11
# File 'lib/se/api/types/question.rb', line 8

def initialize(item_json)
  super(item_json)
  @answers = Array(item_json["answers"]).map { |i| Answer.new(i) }
end

Instance Attribute Details

#answersObject (readonly)

Returns the value of attribute answers.



6
7
8
# File 'lib/se/api/types/question.rb', line 6

def answers
  @answers
end