Class: Twitch::ExtensionsByTypes
- Inherits:
-
Object
- Object
- Twitch::ExtensionsByTypes
- Defined in:
- lib/twitch/extensions_by_types.rb
Overview
A dictionary (Hash) of Extensions by their types and placements
Instance Attribute Summary collapse
-
#component ⇒ Object
readonly
A dictionary that contains the data for a video-component extension.
-
#overlay ⇒ Object
readonly
A dictionary that contains the data for a video-overlay extension.
-
#panel ⇒ Object
readonly
A dictionary that contains the data for a panel extension.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ ExtensionsByTypes
constructor
A new instance of ExtensionsByTypes.
Constructor Details
#initialize(attributes = {}) ⇒ ExtensionsByTypes
Returns a new instance of ExtensionsByTypes.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/twitch/extensions_by_types.rb', line 21 def initialize(attributes = {}) %w[panel overlay component].each do |type| instance_variable_set( "@#{type}", attributes[type].transform_values do |extension_data| Extension.new(extension_data) end ) end end |
Instance Attribute Details
#component ⇒ Object (readonly)
A dictionary that contains the data for a video-component extension. The dictionary’s key is a sequential number beginning with 1. The following fields contain the component’s data for each key.
19 20 21 |
# File 'lib/twitch/extensions_by_types.rb', line 19 def component @component end |
#overlay ⇒ Object (readonly)
A dictionary that contains the data for a video-overlay extension. The dictionary’s key is a sequential number beginning with 1. The following fields contain the overlay’s data for each key.
14 15 16 |
# File 'lib/twitch/extensions_by_types.rb', line 14 def @overlay end |
#panel ⇒ Object (readonly)
A dictionary that contains the data for a panel extension. The dictionary’s key is a sequential number beginning with 1. The following fields contain the panel’s data for each key.
9 10 11 |
# File 'lib/twitch/extensions_by_types.rb', line 9 def panel @panel end |