Class: Twitch::User

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ User

Returns a new instance of User.



25
26
27
28
29
# File 'lib/twitch/user.rb', line 25

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

Instance Attribute Details

#broadcaster_typeObject (readonly)

Represents a special broadcaster role of a user. (partner, affilaite)



14
15
16
# File 'lib/twitch/user.rb', line 14

def broadcaster_type
  @broadcaster_type
end

#descriptionObject (readonly)

Description/biographical info of a user.



16
17
18
# File 'lib/twitch/user.rb', line 16

def description
  @description
end

#display_nameObject (readonly)

Formatted username of the user.



8
9
10
# File 'lib/twitch/user.rb', line 8

def display_name
  @display_name
end

#idObject (readonly)

ID of the user.



4
5
6
# File 'lib/twitch/user.rb', line 4

def id
  @id
end

#loginObject (readonly)

Unformatted (lowercase) username of the user.



6
7
8
# File 'lib/twitch/user.rb', line 6

def 
  @login
end

#offline_image_urlObject (readonly)

URL to the image displayed in the video box when the stream is offline.



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

def offline_image_url
  @offline_image_url
end

#profile_image_urlObject (readonly)

URL to the user’s profile image.



18
19
20
# File 'lib/twitch/user.rb', line 18

def profile_image_url
  @profile_image_url
end

#typeObject (readonly)

Represents a special role of a user. (global mod, admin, staff)



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

def type
  @type
end

#view_countObject (readonly)

Total number of visits to the user’s stream page.



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

def view_count
  @view_count
end