class TriviaCrack::Question

Attributes

answers[R]

Public: The list of possible answers to the question.

category[R]

Public: The category of the question (e.g. :arts, :geography, etc).

correct_answer[R]

Public: The index of the correct answer (based on the :answers property).

id[R]

Public: The unique identifier of the question.

image_url[R]

Public: The URL for the image.

media_type[R]

Public: The type of media used by the question (e.g. :normal, :image).

text[R]

Public: The question text.

type[R]

Public: The type of the question (e.g. :normal, :crown, :duel).

Public Class Methods

new(id:, type: nil, category: nil, text: nil, answers: nil, correct_answer: nil, media_type: nil, image_url: nil) click to toggle source
# File lib/triviacrack/question.rb, line 30
def initialize(id:, type: nil, category: nil, text: nil, answers: nil,
               correct_answer: nil, media_type: nil, image_url: nil)
  @id             = id
  @type           = type
  @category       = category
  @text           = text
  @answers        = answers
  @correct_answer = correct_answer
  @media_type     = media_type
  @image_url      = image_url
end