Class: M3u8::ContentSteeringItem
- Inherits:
-
Object
- Object
- M3u8::ContentSteeringItem
- Extended by:
- M3u8
- Includes:
- AttributeFormatter, Serializable
- Defined in:
- lib/m3u8/content_steering_item.rb
Overview
ContentSteeringItem represents an EXT-X-CONTENT-STEERING tag which indicates a Content Steering Manifest for dynamic pathway selection.
Constant Summary
Constants included from M3u8
Instance Attribute Summary collapse
Class Method Summary collapse
-
.parse(text) ⇒ ContentSteeringItem
Parse an EXT-X-CONTENT-STEERING tag.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ ContentSteeringItem
constructor
A new instance of ContentSteeringItem.
-
#to_s ⇒ String
Render as an m3u8 EXT-X-CONTENT-STEERING tag.
Methods included from M3u8
initialize_with_byterange, parse_attributes, parse_float, parse_int, parse_yes_no, to_yes_no
Methods included from AttributeFormatter
#boolean_format, #decimal_format, #quoted_format, #unquoted_format
Methods included from Serializable
#as_json, serialize, #to_h, #to_json
Constructor Details
#initialize(params = {}) ⇒ ContentSteeringItem
Returns a new instance of ContentSteeringItem.
16 17 18 19 20 |
# File 'lib/m3u8/content_steering_item.rb', line 16 def initialize(params = {}) params.each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#pathway_id ⇒ String?
13 14 15 |
# File 'lib/m3u8/content_steering_item.rb', line 13 def pathway_id @pathway_id end |
#server_uri ⇒ String?
13 14 15 |
# File 'lib/m3u8/content_steering_item.rb', line 13 def server_uri @server_uri end |
Class Method Details
.parse(text) ⇒ ContentSteeringItem
Parse an EXT-X-CONTENT-STEERING tag.
25 26 27 28 29 30 31 |
# File 'lib/m3u8/content_steering_item.rb', line 25 def self.parse(text) attributes = parse_attributes(text) ContentSteeringItem.new( server_uri: attributes['SERVER-URI'], pathway_id: attributes['PATHWAY-ID'] ) end |
Instance Method Details
#to_s ⇒ String
Render as an m3u8 EXT-X-CONTENT-STEERING tag.
35 36 37 |
# File 'lib/m3u8/content_steering_item.rb', line 35 def to_s "#EXT-X-CONTENT-STEERING:#{formatted_attributes}" end |