Class: Twitch::Category
- Inherits:
-
Object
- Object
- Twitch::Category
- Defined in:
- lib/twitch/category.rb
Overview
Data class for categories
Instance Attribute Summary collapse
-
#box_art_url ⇒ Object
readonly
A URL to an image of the game’s box art or streaming category.
-
#id ⇒ Object
readonly
An ID that uniquely identifies the game or category.
-
#igdb_id ⇒ Object
readonly
The ID that IGDB uses to identify this game.
-
#name ⇒ Object
readonly
The name of the game or category.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Category
constructor
A new instance of Category.
Constructor Details
#initialize(attributes = {}) ⇒ Category
Returns a new instance of Category.
21 22 23 24 25 |
# File 'lib/twitch/category.rb', line 21 def initialize(attributes = {}) attributes.each do |key, value| instance_variable_set "@#{key}", value end end |
Instance Attribute Details
#box_art_url ⇒ Object (readonly)
A URL to an image of the game’s box art or streaming category.
7 8 9 |
# File 'lib/twitch/category.rb', line 7 def box_art_url @box_art_url end |
#id ⇒ Object (readonly)
An ID that uniquely identifies the game or category.
13 14 15 |
# File 'lib/twitch/category.rb', line 13 def id @id end |
#igdb_id ⇒ Object (readonly)
The ID that IGDB uses to identify this game. If the IGDB ID is not available to Twitch, this field is set to an empty string.
19 20 21 |
# File 'lib/twitch/category.rb', line 19 def igdb_id @igdb_id end |
#name ⇒ Object (readonly)
The name of the game or category.
10 11 12 |
# File 'lib/twitch/category.rb', line 10 def name @name end |