class Twitch::Clip

A small segment of a broadcast captured by another user.

Constants

DATE_ATTRIBUTES

Fields to be converted from ISO 8601 string to a typed date.

Attributes

broadcaster_id[R]

(User) ID of the clip's source broadcaster.

broadcaster_name[R]

(User) name of the clip's source broadcaster

created_at[R]

Date the clip was created.

creator_id[R]

(User) ID of the clip's creator.

creator_name[R]

(User) name of the clip's creator.

embed_url[R]

URL for embedding the clip.

game_id[R]

ID of the game being played.

id[R]

ID of the clip.

language[R]

Language of the originating broadcast.

thumbnail_url[R]

URL of the thumbnail image.

title[R]

Title of the clip.

url[R]

URL of the clip.

video_id[R]

ID of the archived broadcast (may not be available).

view_count[R]

Number of views.

Public Class Methods

new(attributes = {}) click to toggle source
# File lib/twitch/clip.rb, line 36
def initialize(attributes = {})
  attributes.each do |k, v|
    if DATE_ATTRIBUTES.include?(k.to_sym)
      instance_variable_set("@#{k}", Time.parse(v))
    else
      instance_variable_set("@#{k}", v)
    end
  end
end