Class: JarTools::Diff::EntryIterator
- Inherits:
-
Object
- Object
- JarTools::Diff::EntryIterator
- Defined in:
- lib/jartools/diff.rb
Defined Under Namespace
Classes: AnalyzableEntry
Instance Attribute Summary collapse
-
#index ⇒ Object
Returns the value of attribute index.
Instance Method Summary collapse
- #advance ⇒ Object
- #current ⇒ Object
- #exhausted? ⇒ Boolean
-
#initialize(jarfile, container_files) ⇒ EntryIterator
constructor
A new instance of EntryIterator.
Constructor Details
#initialize(jarfile, container_files) ⇒ EntryIterator
Returns a new instance of EntryIterator.
76 77 78 79 80 81 82 |
# File 'lib/jartools/diff.rb', line 76 def initialize(jarfile, container_files) @jarfile = jarfile @entries = read_directory @container_files = container_files @index = 0 @current_entry_cache = nil end |
Instance Attribute Details
#index ⇒ Object
Returns the value of attribute index.
74 75 76 |
# File 'lib/jartools/diff.rb', line 74 def index @index end |
Instance Method Details
#advance ⇒ Object
95 96 97 98 |
# File 'lib/jartools/diff.rb', line 95 def advance @index += 1 @current_entry_cache = nil end |
#current ⇒ Object
84 85 86 87 88 89 |
# File 'lib/jartools/diff.rb', line 84 def current unless exhausted? @current_entry_cache ||= AnalyzableEntry.new(@jarfile, @entries[index], @container_files) end end |
#exhausted? ⇒ Boolean
91 92 93 |
# File 'lib/jartools/diff.rb', line 91 def exhausted? index >= @entries.size end |