Class: Browser::Element::TimeRanges

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/browser/element/media.rb

Instance Method Summary collapse

Constructor Details

#initialize(native) ⇒ TimeRanges

Returns a new instance of TimeRanges.



50
51
52
# File 'lib/browser/element/media.rb', line 50

def initialize native
  @native = native
end

Instance Method Details

#eachObject



58
59
60
61
62
63
64
# File 'lib/browser/element/media.rb', line 58

def each
  `#@native.length`.times do |i|
    yield TimeRange.new(`#@native.start(i)`, `#@native.end(i)`)
  end

  self
end

#to_nObject



54
55
56
# File 'lib/browser/element/media.rb', line 54

def to_n
  @native
end