class TSparser::AribDuration
Public Class Methods
new(binary)
click to toggle source
# File lib/definition/arib_duration.rb, line 4 def initialize(binary) @hour = binary.read_bit_as_integer(4) * 10 + binary.read_bit_as_integer(4) @min = binary.read_bit_as_integer(4) * 10 + binary.read_bit_as_integer(4) @sec = binary.read_bit_as_integer(4) * 10 + binary.read_bit_as_integer(4) end
Public Instance Methods
to_s()
click to toggle source
# File lib/definition/arib_duration.rb, line 10 def to_s return sprintf("%2d:%2d:%2", @hour, @min, @sec) end
to_sec()
click to toggle source
# File lib/definition/arib_duration.rb, line 14 def to_sec return @hour * 3600 + @min * 60 + @sec end