Class: Twitch::Redemption

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

Overview

Data object for Twitch users

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Redemption

Returns a new instance of Redemption.



29
30
31
32
33
# File 'lib/twitch/redemption.rb', line 29

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

Instance Attribute Details

#broadcaster_display_nameObject (readonly)

Formatted username of the broadcaster.



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

def broadcaster_display_name
  @broadcaster_display_name
end

#broadcaster_idObject (readonly)

ID of the broadcaster.



7
8
9
# File 'lib/twitch/redemption.rb', line 7

def broadcaster_id
  @broadcaster_id
end

#broadcaster_loginObject (readonly)

Unformatted (lowercase) username of thebroadcaster.



9
10
11
# File 'lib/twitch/redemption.rb', line 9

def 
  @broadcaster_login
end

#idObject (readonly)

ID of the redemption.



13
14
15
# File 'lib/twitch/redemption.rb', line 13

def id
  @id
end

#redeemed_atObject (readonly)

The timestamp of the redemption



27
28
29
# File 'lib/twitch/redemption.rb', line 27

def redeemed_at
  @redeemed_at
end

#rewardObject (readonly)

The associated reward being redeemed



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

def reward
  @reward
end

#statusObject (readonly)

The status of the redemption’s fulfillment



25
26
27
# File 'lib/twitch/redemption.rb', line 25

def status
  @status
end

#user_idObject (readonly)

ID of the user.



15
16
17
# File 'lib/twitch/redemption.rb', line 15

def user_id
  @user_id
end

#user_inputObject (readonly)

The user input (e.g. text) if allowed by the reward



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

def user_input
  @user_input
end

#user_loginObject (readonly)

Unformatted (lowercase) username of the user.



17
18
19
# File 'lib/twitch/redemption.rb', line 17

def 
  @user_login
end

#user_nameObject (readonly)

Formatted username of the user.



19
20
21
# File 'lib/twitch/redemption.rb', line 19

def user_name
  @user_name
end