Class: Twitch::Category

Inherits:
Object
  • Object
show all
Defined in:
lib/twitch/category.rb

Overview

Data class for categories

Instance Attribute Summary collapse

Instance Method Summary collapse

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_urlObject (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

#idObject (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_idObject (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

#nameObject (readonly)

The name of the game or category.



10
11
12
# File 'lib/twitch/category.rb', line 10

def name
  @name
end