Class: ArgvIterator

Inherits:
Object
  • Object
show all
Defined in:
lib/git/stash/commit.rb

Overview


Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ ArgvIterator

Returns a new instance of ArgvIterator.



527
528
529
530
# File 'lib/git/stash/commit.rb', line 527

def initialize(argv)
  @argv = argv
  @index = 0
end

Instance Method Details

#nextObject



536
537
538
539
540
541
542
543
544
545
546
# File 'lib/git/stash/commit.rb', line 536

def next
  if @index < @argv.length
    ret = @argv[@index]
    @index += 1
    return ret
  else
    puts '* error: argument is not enoufh'
    usage
    raise ''
  end
end

#next?Boolean

Returns:

  • (Boolean)


532
533
534
# File 'lib/git/stash/commit.rb', line 532

def next?
  @index < @argv.length
end