Class: Twitch::User
- Inherits:
-
Object
- Object
- Twitch::User
- Defined in:
- lib/twitch/user.rb
Instance Attribute Summary collapse
-
#broadcaster_type ⇒ Object
readonly
Represents a special broadcaster role of a user.
-
#description ⇒ Object
readonly
Description/biographical info of a user.
-
#display_name ⇒ Object
readonly
Formatted username of the user.
-
#id ⇒ Object
readonly
ID of the user.
-
#login ⇒ Object
readonly
Unformatted (lowercase) username of the user.
-
#offline_image_url ⇒ Object
readonly
URL to the image displayed in the video box when the stream is offline.
-
#profile_image_url ⇒ Object
readonly
URL to the user’s profile image.
-
#type ⇒ Object
readonly
Represents a special role of a user.
-
#view_count ⇒ Object
readonly
Total number of visits to the user’s stream page.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ User
constructor
A new instance of User.
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_type ⇒ Object (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 |
#description ⇒ Object (readonly)
Description/biographical info of a user.
16 17 18 |
# File 'lib/twitch/user.rb', line 16 def description @description end |
#display_name ⇒ Object (readonly)
Formatted username of the user.
8 9 10 |
# File 'lib/twitch/user.rb', line 8 def display_name @display_name end |
#id ⇒ Object (readonly)
ID of the user.
4 5 6 |
# File 'lib/twitch/user.rb', line 4 def id @id end |
#login ⇒ Object (readonly)
Unformatted (lowercase) username of the user.
6 7 8 |
# File 'lib/twitch/user.rb', line 6 def login @login end |
#offline_image_url ⇒ Object (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_url ⇒ Object (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 |
#type ⇒ Object (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_count ⇒ Object (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 |