Class: Microstation::Enumerator

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/microstation/enumerator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ole, app) ⇒ Enumerator

Returns a new instance of Enumerator.



11
12
13
14
# File 'lib/microstation/enumerator.rb', line 11

def initialize(ole,app)
  @ole_obj = ole
  @app = app
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



9
10
11
# File 'lib/microstation/enumerator.rb', line 9

def app
  @app
end

Instance Method Details

#eachObject



16
17
18
19
20
21
22
# File 'lib/microstation/enumerator.rb', line 16

def each
  return enum_for(:each) unless block_given?
  while @ole_obj.MoveNext
    item = @ole_obj.Current
    yield Microstation::Wrap.wrap(item,app)
  end
end

#resetObject



24
25
26
# File 'lib/microstation/enumerator.rb', line 24

def reset
  @ole_obj.reset
end