Class: Twitch::Video

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

Overview

A captured broadcast or portion of a broadcast.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Video

Returns a new instance of Video.



37
38
39
40
41
# File 'lib/twitch/video.rb', line 37

def initialize(attributes = {})
  attributes.each do |key, value|
    instance_variable_set("@#{key}", value)
  end
end

Instance Attribute Details

#created_atObject (readonly)

Date the video was created.



19
20
21
# File 'lib/twitch/video.rb', line 19

def created_at
  @created_at
end

#descriptionObject (readonly)

Description of the video.



13
14
15
# File 'lib/twitch/video.rb', line 13

def description
  @description
end

#durationObject (readonly)

Duration of the video, in the format ‘0h0m0s`



35
36
37
# File 'lib/twitch/video.rb', line 35

def duration
  @duration
end

#idObject (readonly)

ID of the video.



9
10
11
# File 'lib/twitch/video.rb', line 9

def id
  @id
end

#languageObject (readonly)

Language of the video.



15
16
17
# File 'lib/twitch/video.rb', line 15

def language
  @language
end

#published_atObject (readonly)

Date the video was published.



21
22
23
# File 'lib/twitch/video.rb', line 21

def published_at
  @published_at
end

#thumbnail_urlObject (readonly)

URL to the thumbnail image of the video.



23
24
25
# File 'lib/twitch/video.rb', line 23

def thumbnail_url
  @thumbnail_url
end

#titleObject (readonly)

Title of the video.



11
12
13
# File 'lib/twitch/video.rb', line 11

def title
  @title
end

#typeObject (readonly)

Type of the video (archive, highlight or upload).



25
26
27
# File 'lib/twitch/video.rb', line 25

def type
  @type
end

#urlObject (readonly)

URL of the video.



27
28
29
# File 'lib/twitch/video.rb', line 27

def url
  @url
end

#user_idObject (readonly)

ID of the user who uploaded/broadcasted the video.



29
30
31
# File 'lib/twitch/video.rb', line 29

def user_id
  @user_id
end

#user_nameObject (readonly)

Display name of the user who uploaded/broadcasted the video.



31
32
33
# File 'lib/twitch/video.rb', line 31

def user_name
  @user_name
end

#view_countObject (readonly)

Number of views



17
18
19
# File 'lib/twitch/video.rb', line 17

def view_count
  @view_count
end

#viewableObject (readonly)

Viewability of the video (public or private)



33
34
35
# File 'lib/twitch/video.rb', line 33

def viewable
  @viewable
end