Class: Iterator

Inherits:
Object
  • Object
show all
Defined in:
lib/jiji/util/iterator.rb

Overview

イテレータ

Instance Method Summary collapse

Instance Method Details

#closeObject

イテレータを破棄



21
22
# File 'lib/jiji/util/iterator.rb', line 21

def close
end

#eachObject

列挙します



5
6
7
8
9
10
11
12
13
# File 'lib/jiji/util/iterator.rb', line 5

def each
  begin
    while next?
      yield self.next
    end
  ensure
    self.close
  end
end

#nextObject

次の要素を取得



18
19
# File 'lib/jiji/util/iterator.rb', line 18

def next
end

#next?Boolean

次があるか評価する

Returns:

  • (Boolean)


15
16
# File 'lib/jiji/util/iterator.rb', line 15

def next?
end