Class: Unidata::SelectList
- Inherits:
-
Object
- Object
- Unidata::SelectList
- Includes:
- Enumerable
- Defined in:
- lib/unidata/select_list.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(uniselect_list, should_cache = false) ⇒ SelectList
constructor
A new instance of SelectList.
Constructor Details
#initialize(uniselect_list, should_cache = false) ⇒ SelectList
Returns a new instance of SelectList.
5 6 7 8 9 10 |
# File 'lib/unidata/select_list.rb', line 5 def initialize(uniselect_list, should_cache=false) @uniselect_list = uniselect_list @should_cache = should_cache @cache = [] @exhausted = false end |
Instance Method Details
#each(&block) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/unidata/select_list.rb', line 12 def each &block return [] if @exhausted && !@should_cache if @exhausted @cache.each &block else iterate &block end end |