Class: Twitch::CheermoteTier
- Inherits:
-
Object
- Object
- Twitch::CheermoteTier
- Defined in:
- lib/twitch/cheermote_tier.rb
Overview
Data class for Cheermote Tier. Each tier identifies the range of Bits that you can cheer at that tier level and an image that graphically identifies the tier level.
Instance Attribute Summary collapse
-
#can_cheer ⇒ Object
readonly
A Boolean value that determines whether users can cheer at this tier level.
-
#color ⇒ Object
readonly
The hex code of the color associated with this tier level (for example, ‘#979797`).
-
#id ⇒ Object
readonly
The tier level.
-
#images ⇒ Object
readonly
The animated and static image sets for the Cheermote.
-
#min_bits ⇒ Object
readonly
The minimum number of Bits that you must cheer at this tier level.
-
#show_in_bits_card ⇒ Object
readonly
A Boolean value that determines whether this tier level is shown in the Bits card.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ CheermoteTier
constructor
A new instance of CheermoteTier.
Constructor Details
#initialize(attributes = {}) ⇒ CheermoteTier
Returns a new instance of CheermoteTier.
47 48 49 50 51 52 53 |
# File 'lib/twitch/cheermote_tier.rb', line 47 def initialize(attributes = {}) attributes.each do |key, value| value = CheermoteTierImages.new(value) if key == 'images' instance_variable_set "@#{key}", value end end |
Instance Attribute Details
#can_cheer ⇒ Object (readonly)
A Boolean value that determines whether users can cheer at this tier level.
41 42 43 |
# File 'lib/twitch/cheermote_tier.rb', line 41 def can_cheer @can_cheer end |
#color ⇒ Object (readonly)
The hex code of the color associated with this tier level (for example, ‘#979797`).
30 31 32 |
# File 'lib/twitch/cheermote_tier.rb', line 30 def color @color end |
#id ⇒ Object (readonly)
The tier level. Possible tiers are:
-
1
-
100
-
500
-
1000
-
5000
-
10000
-
100000
27 28 29 |
# File 'lib/twitch/cheermote_tier.rb', line 27 def id @id end |
#images ⇒ Object (readonly)
The animated and static image sets for the Cheermote. The dictionary of images is organized by theme, format, and size. The theme keys are ‘dark` and `light`. Each theme is a dictionary of formats: `animated` and `static`. Each format is a dictionary of sizes: `1`, `1.5`, `2`, `3`, and `4`. The value of each size contains the URL to the image.
38 39 40 |
# File 'lib/twitch/cheermote_tier.rb', line 38 def images @images end |
#min_bits ⇒ Object (readonly)
The minimum number of Bits that you must cheer at this tier level. The maximum number of Bits that you can cheer at this level is determined by the required minimum Bits of the next tier level minus 1. For example, if ‘min_bits` is 1 and `min_bits` for the next tier is 100, the Bits range for this tier level is 1 through 99. The minimum Bits value of the last tier is the maximum number of Bits you can cheer using this Cheermote. For example, 10000.
17 18 19 |
# File 'lib/twitch/cheermote_tier.rb', line 17 def min_bits @min_bits end |
#show_in_bits_card ⇒ Object (readonly)
A Boolean value that determines whether this tier level is shown in the Bits card. Is ‘true` if this tier level is shown in the Bits card.
45 46 47 |
# File 'lib/twitch/cheermote_tier.rb', line 45 def show_in_bits_card @show_in_bits_card end |