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.
11 12 13 14 |
# File 'lib/microstation/enumerator.rb', line 11 def initialize(ole,app) @ole_obj = ole @app = app end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
9 10 11 |
# File 'lib/microstation/enumerator.rb', line 9 def app @app end |
Instance Method Details
#each ⇒ Object
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 |
#reset ⇒ Object
24 25 26 |
# File 'lib/microstation/enumerator.rb', line 24 def reset @ole_obj.reset end |