Class: Nanoc::Extra::Checking::Checks::ExternalLinks::ArrayEnumerator

Inherits:
Object
  • Object
show all
Defined in:
lib/nanoc/extra/checking/checks/external_links.rb

Instance Method Summary (collapse)

Constructor Details

- (ArrayEnumerator) initialize(array)

Returns a new instance of ArrayEnumerator



43
44
45
46
47
# File 'lib/nanoc/extra/checking/checks/external_links.rb', line 43

def initialize(array)
  @array = array
  @index = 0
  @mutex = Mutex.new
end

Instance Method Details

- (Object) next



49
50
51
52
53
54
# File 'lib/nanoc/extra/checking/checks/external_links.rb', line 49

def next
  @mutex.synchronize do
    @index += 1
    return @array[@index - 1]
  end
end