Class: Browser::Iterable

Inherits:
Object show all
Includes:
Enumerable
Defined in:
lib/browser/iterable.rb

Instance Method Summary collapse

Constructor Details

#initialize(js_iterable) ⇒ Iterable

Returns a new instance of Iterable.



5
6
7
# File 'lib/browser/iterable.rb', line 5

def initialize js_iterable
  @js_iterable = js_iterable
end

Instance Method Details

#eachObject



9
10
11
12
13
# File 'lib/browser/iterable.rb', line 9

def each
  `#@js_iterable.length`.times do |i|
    yield `#@js_iterable[i]`
  end
end