Class: Twitch::Subscription
- Inherits:
-
Object
- Object
- Twitch::Subscription
- Defined in:
- lib/twitch/subscription.rb
Overview
A user’s voluntary contribution to a streamer
Instance Attribute Summary collapse
-
#broadcaster_id ⇒ Object
readonly
ID of the user being subscribed to.
-
#broadcaster_name ⇒ Object
readonly
Username of the user being subscribed to.
-
#is_gift ⇒ Object
readonly
Whether the subscription was received as a gift.
-
#plan_name ⇒ Object
readonly
Descriptive name of the subscription.
-
#tier ⇒ Object
readonly
Tier of the subscription.
-
#user_id ⇒ Object
readonly
ID of the subscribing user.
-
#user_name ⇒ Object
readonly
Username of the subscribing user.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Subscription
constructor
A new instance of Subscription.
Constructor Details
#initialize(attributes = {}) ⇒ Subscription
Returns a new instance of Subscription.
22 23 24 25 26 |
# File 'lib/twitch/subscription.rb', line 22 def initialize(attributes = {}) attributes.each do |key, value| instance_variable_set "@#{key}", value end end |
Instance Attribute Details
#broadcaster_id ⇒ Object (readonly)
ID of the user being subscribed to.
7 8 9 |
# File 'lib/twitch/subscription.rb', line 7 def broadcaster_id @broadcaster_id end |
#broadcaster_name ⇒ Object (readonly)
Username of the user being subscribed to.
9 10 11 |
# File 'lib/twitch/subscription.rb', line 9 def broadcaster_name @broadcaster_name end |
#is_gift ⇒ Object (readonly)
Whether the subscription was received as a gift.
11 12 13 |
# File 'lib/twitch/subscription.rb', line 11 def is_gift @is_gift end |
#plan_name ⇒ Object (readonly)
Descriptive name of the subscription.
16 17 18 |
# File 'lib/twitch/subscription.rb', line 16 def plan_name @plan_name end |
#tier ⇒ Object (readonly)
Tier of the subscription. 1000 = Tier 1, 2000 = Tier 2, 3000 = Tier 3
14 15 16 |
# File 'lib/twitch/subscription.rb', line 14 def tier @tier end |
#user_id ⇒ Object (readonly)
ID of the subscribing user.
18 19 20 |
# File 'lib/twitch/subscription.rb', line 18 def user_id @user_id end |
#user_name ⇒ Object (readonly)
Username of the subscribing user.
20 21 22 |
# File 'lib/twitch/subscription.rb', line 20 def user_name @user_name end |