Class: JAPI::Category
- Inherits:
-
Object
- Object
- JAPI::Category
- Defined in:
- lib/japi/category.rb
Instance Method Summary collapse
- #category_id ⇒ Object
- #clues ⇒ Object
- #clues_count ⇒ Object
-
#initialize(options = {}) ⇒ Category
constructor
A new instance of Category.
- #title ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Category
Returns a new instance of Category.
4 5 6 7 8 9 |
# File 'lib/japi/category.rb', line 4 def initialize( = {}) = if ["clues"] ["clues"] = ["clues"].map { |clue| Clue.new(clue) } end end |
Instance Method Details
#category_id ⇒ Object
15 16 17 |
# File 'lib/japi/category.rb', line 15 def category_id ["id"] end |
#clues ⇒ Object
23 24 25 26 |
# File 'lib/japi/category.rb', line 23 def clues return ["clues"] unless ["clues"].nil? ["clues"] = Trebek.category(10044).clues end |
#clues_count ⇒ Object
19 20 21 |
# File 'lib/japi/category.rb', line 19 def clues_count ["clues_count"] end |
#title ⇒ Object
11 12 13 |
# File 'lib/japi/category.rb', line 11 def title ["title"] end |