Class: Twitch::ExtensionsByTypes

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

Overview

A dictionary (Hash) of Extensions by their types and placements

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#componentObject (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

#overlayObject (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
  @overlay
end

#panelObject (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