class M3U8::ByteRange
- M3U8::ByteRange
- Reference
- Object
Overview
ByteRange represents sub range of a resource
Included Modules
- M3U8::Concern
Extended Modules
- M3U8::Concern
Defined in:
m3u8/byte_range.crConstructors
- .new(string : String)
-
.new(params : NamedTuple = NamedTuple.new)
options = {length: 4500, start: 600} ByteRange.new(options) ByteRange.new(length: 4500, start: 600)
- .new(length : Int32 | Nil = nil, start : Int32 | Nil = nil)
Class Method Summary
-
.parse(item = nil)
ByteRange.parse(ByteRange.new(length: 4500, start: 600)) ByteRange.parse({length: 4500, start: 600}) ByteRange.parse("4500@600") ByteRange.parse
Instance Method Summary
-
#==(other : String)
left = ByteRange.new(length: 4500, start: 600) right = "4500@600", left == right # => true
-
#==(other : NamedTuple)
left = ByteRange.new(length: 4500, start: 600) right = { length: 4500, start: 600 }, left == right # => true
-
#==(other : ByteRange)
left = ByteRange.new(length: 4500, start: 600), right = ByteRange.new(length: 4500, start: 600) left == right # => true
-
#empty?
byterange = ByteRange.new byterange.empty? # => true byterange = ByteRange.new(length: 0) byterange.empty? # => true byterange.length = 4500 byterange.empty? # => false
- #length : Int32 | Nil
- #length=(length : Int32 | Nil)
- #start : Int32 | Nil
- #start=(start : Int32 | Nil)
-
#to_s
byterange = ByteRange.new(length: 4500, start: 600) byterange.to_s # => "4500@600" byterange = ByteRange.new(length: 4500) byterange.to_s # => "4500" byterange = ByteRange.new byterange.to_s # => ""
Constructor Detail
options = {length: 4500, start: 600}
ByteRange.new(options)
ByteRange.new(length: 4500, start: 600)
Class Method Detail
ByteRange.parse(ByteRange.new(length: 4500, start: 600))
ByteRange.parse({length: 4500, start: 600})
ByteRange.parse("4500@600")
ByteRange.parse
Instance Method Detail
left = ByteRange.new(length: 4500, start: 600)
right = "4500@600",
left == right # => true
left = ByteRange.new(length: 4500, start: 600)
right = { length: 4500, start: 600 },
left == right # => true
left = ByteRange.new(length: 4500, start: 600),
right = ByteRange.new(length: 4500, start: 600)
left == right # => true
byterange = ByteRange.new
byterange.empty? # => true
byterange = ByteRange.new(length: 0)
byterange.empty? # => true
byterange.length = 4500
byterange.empty? # => false
byterange = ByteRange.new(length: 4500, start: 600)
byterange.to_s # => "4500@600"
byterange = ByteRange.new(length: 4500)
byterange.to_s # => "4500"
byterange = ByteRange.new
byterange.to_s # => ""