Class: JAPI::Clue

Inherits:
Object
  • Object
show all
Defined in:
lib/japi/clue.rb

Overview

Clue object with a question, answer and other details.

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Clue

Returns a new instance of Clue.

Options Hash (options):

  • :value (Fixnum)

    amount in dollars of question

  • :id (Fixnum)

    clue id

  • :category_id (Fixnum)

    id of the clue’s category

  • :game_id (Fixnum)

    id of the game where the clue appeared

  • :category (Hash)

    Hash containing Category info. see JAPI::Category

  • :question (String)

    the question text

  • :answer (String)

    the answer text



16
17
18
# File 'lib/japi/clue.rb', line 16

def initialize(options = {})
  @options = options
end

Instance Method Details

#answerString



51
52
53
# File 'lib/japi/clue.rb', line 51

def answer
  @options["answer"]
end

#categoryCategory



36
37
38
# File 'lib/japi/clue.rb', line 36

def category
  Category.new(@options["category"])
end

#category_idFixnum



31
32
33
# File 'lib/japi/clue.rb', line 31

def category_id
  @options["category_id"]
end

#clue_idFixnum



26
27
28
# File 'lib/japi/clue.rb', line 26

def clue_id
  @options["id"]
end

#game_idFixnum



41
42
43
# File 'lib/japi/clue.rb', line 41

def game_id
  @options["game_id"]
end

#questionString



46
47
48
# File 'lib/japi/clue.rb', line 46

def question
  @options["question"]
end

#valueFixnum



21
22
23
# File 'lib/japi/clue.rb', line 21

def value
  @options["value"]
end