Class: Microstation::Enumerator
- Inherits:
-
Object
- Object
- Microstation::Enumerator
- Includes:
- Enumerable
- Defined in:
- lib/microstation/enumerator.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(ole, app) ⇒ Enumerator
constructor
A new instance of Enumerator.
- #reset ⇒ Object
Constructor Details
#initialize(ole, app) ⇒ Enumerator
Returns a new instance of Enumerator.
9 10 11 12 |
# File 'lib/microstation/enumerator.rb', line 9 def initialize(ole, app) @ole_obj = ole @app = app end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
7 8 9 |
# File 'lib/microstation/enumerator.rb', line 7 def app @app end |
Instance Method Details
#each ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/microstation/enumerator.rb', line 14 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 |
#reset ⇒ Object
23 24 25 |
# File 'lib/microstation/enumerator.rb', line 23 def reset @ole_obj.reset end |