Class: Twitch::V2::Stream
- Inherits:
-
Object
- Object
- Twitch::V2::Stream
- Defined in:
- lib/kappa/stream.rb
Overview
Streams are video broadcasts that are currently live. They belong to a user and are part of a channel.
Instance Attribute Summary collapse
-
#broadcaster ⇒ String
readonly
deprecated
Deprecated.
This attribute is not present in the V3 API.
-
#channel ⇒ Channel
readonly
The
Channel
associated with this stream. -
#game_name ⇒ String
readonly
The name of the game currently being streamed.
-
#id ⇒ Fixnum
readonly
Unique Twitch ID.
-
#name ⇒ String
readonly
The unique Twitch name for this stream.
-
#preview_url ⇒ String
readonly
URL of a preview screenshot taken from the video stream.
-
#url ⇒ String
readonly
The URL for this stream.
-
#viewer_count ⇒ Fixnum
readonly
The number of viewers currently watching the stream.
Instance Method Summary collapse
-
#user ⇒ User
Get the owner of this stream.
Instance Attribute Details
#broadcaster ⇒ String (readonly)
This attribute is not present in the V3 API.
Returns The broadcasting software used for this stream.
42 43 44 |
# File 'lib/kappa/stream.rb', line 42 def broadcaster @broadcaster end |
#channel ⇒ Channel (readonly)
This does not incur any web requests.
Returns The Channel
associated with this stream.
66 67 68 |
# File 'lib/kappa/stream.rb', line 66 def channel @channel end |
#game_name ⇒ String (readonly)
Returns The name of the game currently being streamed.
47 48 49 |
# File 'lib/kappa/stream.rb', line 47 def game_name @game_name end |
#id ⇒ Fixnum (readonly)
Returns Unique Twitch ID.
36 37 38 |
# File 'lib/kappa/stream.rb', line 36 def id @id end |
#name ⇒ String (readonly)
Returns The unique Twitch name for this stream.
52 53 54 |
# File 'lib/kappa/stream.rb', line 52 def name @name end |
#preview_url ⇒ String (readonly)
Returns URL of a preview screenshot taken from the video stream.
62 63 64 |
# File 'lib/kappa/stream.rb', line 62 def preview_url @preview_url end |
#url ⇒ String (readonly)
Returns The URL for this stream.
71 72 73 |
# File 'lib/kappa/stream.rb', line 71 def url @url end |
#viewer_count ⇒ Fixnum (readonly)
Returns The number of viewers currently watching the stream.
57 58 59 |
# File 'lib/kappa/stream.rb', line 57 def viewer_count @viewer_count end |
Instance Method Details
#user ⇒ User
This incurs an additional web request.
Get the owner of this stream.
29 30 31 |
# File 'lib/kappa/stream.rb', line 29 def user @query.users.get(@channel.name) end |