class M3U8::TimeItem

Overview

TimeItem represents EXT-X-PROGRAM-DATE-TIME

Included Modules

Extended Modules

Defined in:

m3u8/time_item.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(params : NamedTuple = NamedTuple.new) #
Time.iso8601("2010-02-19T14:54:23.031Z")
# => "#EXT-X-PROGRAM-DATE-TIME:2010-02-19T14:54:23.031Z"

[View source]
def self.new(time = nil) #
TimeItem.new("2010-02-19T14:54:23Z")
# => #<M3U8::TimeItem:0x10581b920 @time=2010-02-19 14:54:23 UTC>
TimeItem.new(Time.iso8601("2010-02-19T14:54:23.031Z"))
# => #<M3U8::TimeItem:0x10581b920 @time=2010-02-19 14:54:23 UTC>
TimeItem.new
# => #<M3U8::TimeItem:0x10581b880 @time=1970-01-01 00:00:00 UTC>

[View source]

Class Method Detail

def self.parse(item = nil) #
TimeItem.parse(TimeItem.new("2010-02-19T14:54:23Z"))
TimeItem.parse(Time.iso8601("2010-02-19T14:54:23.031Z"))
TimeItem.parse("2010-02-19T14:54:23.031Z")
TimeItem.parse

[View source]

Instance Method Detail

def empty? #
item = TimeItem.new
item.empty? # => true
item = TimeItem.new("2010-02-19T14:54:23Z")
item.empty? # => false

[View source]
def time : Time #

[View source]
def time=(time : Time) #

[View source]
def to_s #
TimeItem.new("2010-02-19T14:54:23Z").to_s
# => "#EXT-X-PROGRAM-DATE-TIME:2010-02-19T14:54:23.031Z"
TimeItem.new(Time.iso8601("2010-02-19T14:54:23.031Z"))
# => "#EXT-X-PROGRAM-DATE-TIME:2010-02-19T14:54:23.031Z"

[View source]