Class: JAPI::Category
- Inherits:
-
Object
- Object
- JAPI::Category
- Defined in:
- lib/japi/category.rb
Overview
Category object with associated clues and a title.
Instance Method Summary collapse
-
#category_id ⇒ Fixnum
Id of the category.
-
#clues ⇒ Array<Clue>
Array of clues associated with a Category.
-
#clues_count ⇒ Fixnum
Amount of clues associated with this category.
-
#initialize(options = {}) ⇒ Category
constructor
A new instance of Category.
-
#title ⇒ String
Title of the category.
Constructor Details
Instance Method Details
#category_id ⇒ Fixnum
Returns id of the category.
24 25 26 |
# File 'lib/japi/category.rb', line 24 def category_id @options["id"] end |
#clues ⇒ Array<Clue>
Returns array of clues associated with a Category.
34 35 36 37 |
# File 'lib/japi/category.rb', line 34 def clues return @options["clues"] unless @options["clues"].nil? @options["clues"] = Trebek.category(category_id).clues end |
#clues_count ⇒ Fixnum
Returns amount of clues associated with this category.
29 30 31 |
# File 'lib/japi/category.rb', line 29 def clues_count @options["clues_count"] end |
#title ⇒ String
Returns title of the category.
19 20 21 |
# File 'lib/japi/category.rb', line 19 def title @options["title"] end |