Class: Twitch::User
- Inherits:
-
Object
- Object
- Twitch::User
- Defined in:
- lib/twitch/user.rb
Overview
Data object for Twitch users
Instance Attribute Summary collapse
-
#broadcaster_type ⇒ Object
readonly
Represents a special broadcaster role of a user.
-
#created_at ⇒ Object
readonly
The UTC date and time that the user’s account was created.
-
#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.
30 31 32 33 34 |
# File 'lib/twitch/user.rb', line 30 def initialize(attributes = {}) attributes.each do |key, value| instance_variable_set "@#{key}", value end end |
Instance Attribute Details
#broadcaster_type ⇒ Object (readonly)
Represents a special broadcaster role of a user. (partner, affiliate)
17 18 19 |
# File 'lib/twitch/user.rb', line 17 def broadcaster_type @broadcaster_type end |
#created_at ⇒ Object (readonly)
The UTC date and time that the user’s account was created. The timestamp is in RFC3339 format.
28 29 30 |
# File 'lib/twitch/user.rb', line 28 def created_at @created_at end |
#description ⇒ Object (readonly)
Description/biographical info of a user.
19 20 21 |
# File 'lib/twitch/user.rb', line 19 def description @description end |
#display_name ⇒ Object (readonly)
Formatted username of the user.
11 12 13 |
# File 'lib/twitch/user.rb', line 11 def display_name @display_name end |
#id ⇒ Object (readonly)
ID of the user.
7 8 9 |
# File 'lib/twitch/user.rb', line 7 def id @id end |
#login ⇒ Object (readonly)
Unformatted (lowercase) username of the user.
9 10 11 |
# File 'lib/twitch/user.rb', line 9 def login @login end |
#offline_image_url ⇒ Object (readonly)
URL to the image displayed in the video box when the stream is offline.
24 25 26 |
# File 'lib/twitch/user.rb', line 24 def offline_image_url @offline_image_url end |
#profile_image_url ⇒ Object (readonly)
URL to the user’s profile image.
21 22 23 |
# File 'lib/twitch/user.rb', line 21 def profile_image_url @profile_image_url end |
#type ⇒ Object (readonly)
Represents a special role of a user. (global mod, admin, staff)
14 15 16 |
# File 'lib/twitch/user.rb', line 14 def type @type end |
#view_count ⇒ Object (readonly)
Total number of visits to the user’s stream page.
26 27 28 |
# File 'lib/twitch/user.rb', line 26 def view_count @view_count end |