Class: Twitch::Channel
- Inherits:
-
Object
- Object
- Twitch::Channel
- Defined in:
- lib/twitch/channel.rb
Overview
Data object for Twitch channels dev.twitch.tv/docs/api/reference#get-channel-information
Instance Attribute Summary collapse
-
#broadcaster_id ⇒ Object
readonly
Twitch User ID of this channel owner.
-
#broadcaster_language ⇒ Object
readonly
Language of the channel.
-
#broadcaster_login ⇒ Object
readonly
Broadcaster’s user login name.
-
#broadcaster_name ⇒ Object
readonly
Twitch user display name of this channel owner.
-
#delay ⇒ Object
readonly
Stream delay in seconds.
-
#display_name ⇒ Object
readonly
Returns the value of attribute display_name.
-
#game_id ⇒ Object
readonly
Current game ID being played on the channel .
-
#game_name ⇒ Object
readonly
Name of the game being played on the channel.
-
#id ⇒ Object
readonly
Some endpoints, like “Search Channels”, can return different fields.
-
#is_live ⇒ Object
readonly
A Boolean value that determines whether the broadcaster is streaming live.
-
#started_at ⇒ Object
readonly
The UTC date and time (in RFC3339 format) of when the broadcaster started streaming.
-
#tags ⇒ Object
readonly
The tags applied to the channel.
-
#thumbnail_url ⇒ Object
readonly
A URL to a thumbnail of the broadcaster’s profile image.
-
#title ⇒ Object
readonly
Title of the stream.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Channel
constructor
A new instance of Channel.
Constructor Details
#initialize(attributes = {}) ⇒ Channel
Returns a new instance of Channel.
40 41 42 43 44 |
# File 'lib/twitch/channel.rb', line 40 def initialize(attributes = {}) attributes.each do |key, value| instance_variable_set "@#{key}", value end end |
Instance Attribute Details
#broadcaster_id ⇒ Object (readonly)
Twitch User ID of this channel owner.
8 9 10 |
# File 'lib/twitch/channel.rb', line 8 def broadcaster_id @broadcaster_id end |
#broadcaster_language ⇒ Object (readonly)
Language of the channel. A language value is either the ISO 639-1 two-letter code for a supported stream language or “other”.
16 17 18 |
# File 'lib/twitch/channel.rb', line 16 def broadcaster_language @broadcaster_language end |
#broadcaster_login ⇒ Object (readonly)
Broadcaster’s user login name.
10 11 12 |
# File 'lib/twitch/channel.rb', line 10 def broadcaster_login @broadcaster_login end |
#broadcaster_name ⇒ Object (readonly)
Twitch user display name of this channel owner.
12 13 14 |
# File 'lib/twitch/channel.rb', line 12 def broadcaster_name @broadcaster_name end |
#delay ⇒ Object (readonly)
Stream delay in seconds.
24 25 26 |
# File 'lib/twitch/channel.rb', line 24 def delay @delay end |
#display_name ⇒ Object (readonly)
Returns the value of attribute display_name.
28 29 30 |
# File 'lib/twitch/channel.rb', line 28 def display_name @display_name end |
#game_id ⇒ Object (readonly)
Current game ID being played on the channel .
18 19 20 |
# File 'lib/twitch/channel.rb', line 18 def game_id @game_id end |
#game_name ⇒ Object (readonly)
Name of the game being played on the channel.
20 21 22 |
# File 'lib/twitch/channel.rb', line 20 def game_name @game_name end |
#id ⇒ Object (readonly)
Some endpoints, like “Search Channels”, can return different fields
27 28 29 |
# File 'lib/twitch/channel.rb', line 27 def id @id end |
#is_live ⇒ Object (readonly)
A Boolean value that determines whether the broadcaster is streaming live. Is true if the broadcaster is streaming live; otherwise, false.
31 32 33 |
# File 'lib/twitch/channel.rb', line 31 def is_live @is_live end |
#started_at ⇒ Object (readonly)
The UTC date and time (in RFC3339 format) of when the broadcaster started streaming. The string is empty if the broadcaster is not streaming live.
38 39 40 |
# File 'lib/twitch/channel.rb', line 38 def started_at @started_at end |
#tags ⇒ Object (readonly)
The tags applied to the channel.
33 34 35 |
# File 'lib/twitch/channel.rb', line 33 def @tags end |
#thumbnail_url ⇒ Object (readonly)
A URL to a thumbnail of the broadcaster’s profile image.
35 36 37 |
# File 'lib/twitch/channel.rb', line 35 def thumbnail_url @thumbnail_url end |
#title ⇒ Object (readonly)
Title of the stream.
22 23 24 |
# File 'lib/twitch/channel.rb', line 22 def title @title end |