Class: Twitch::Subscription

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

Overview

A user’s voluntary contribution to a streamer

Instance Attribute Summary collapse

Instance Method Summary collapse

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_idObject (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_nameObject (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_giftObject (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_nameObject (readonly)

Descriptive name of the subscription.



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

def plan_name
  @plan_name
end

#tierObject (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_idObject (readonly)

ID of the subscribing user.



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

def user_id
  @user_id
end

#user_nameObject (readonly)

Username of the subscribing user.



20
21
22
# File 'lib/twitch/subscription.rb', line 20

def user_name
  @user_name
end