Class: CFBundle::Resource::Enumerator
- Inherits:
-
Object
- Object
- CFBundle::Resource::Enumerator
- Defined in:
- lib/cfbundle/resource.rb
Overview
Performs the enumeration of a bundle’s resources.
Instance Method Summary collapse
-
#initialize(bundle, subdirectory, localization, preferred_languages) ⇒ Enumerator
constructor
A new instance of Enumerator.
-
#next ⇒ Resource
Returns the next resource in the bundle.
Constructor Details
#initialize(bundle, subdirectory, localization, preferred_languages) ⇒ Enumerator
Returns a new instance of Enumerator.
106 107 108 109 110 111 112 |
# File 'lib/cfbundle/resource.rb', line 106 def initialize(bundle, subdirectory, localization, preferred_languages) @bundle = bundle @directory = PathUtils.join(bundle.resources_directory, subdirectory) @localizations = localizations_for(bundle, localization, preferred_languages) @enumerator = [].to_enum end |
Instance Method Details
#next ⇒ Resource
Returns the next resource in the bundle.
118 119 120 121 122 123 |
# File 'lib/cfbundle/resource.rb', line 118 def next Resource.new(@bundle, @enumerator.next) rescue StopIteration @enumerator = next_enumerator retry end |