Class: ArgvIterator
- Inherits:
-
Object
- Object
- ArgvIterator
- Defined in:
- lib/git/stash/commit.rb
Overview
Instance Method Summary collapse
-
#initialize(argv) ⇒ ArgvIterator
constructor
A new instance of ArgvIterator.
- #next ⇒ Object
- #next? ⇒ Boolean
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
#next ⇒ Object
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
532 533 534 |
# File 'lib/git/stash/commit.rb', line 532 def next? @index < @argv.length end |