Method: Chars::CharSet#each_string_of_length
- Defined in:
- lib/chars/char_set.rb
#each_string_of_length(length) {|string| ... } ⇒ Enumerator
Enumerates through every possible string belonging to the Chars::CharSet and of the given length.
625 626 627 628 629 630 631 632 633 634 635 636 |
# File 'lib/chars/char_set.rb', line 625 def each_string_of_length(length,&block) return enum_for(__method__,length) unless block case length when Range, Array length.each do |len| StringEnumerator.new(self,len).each(&block) end else StringEnumerator.new(self,length).each(&block) end end |