Parent

Methods

Wordlist::FlatFile

Attributes

path[RW]

The path to the flat-file

Public Class Methods

new(path,options={},&block) click to toggle source

Creates a new FlatFile list with the specified path and given options.

# File lib/wordlist/flat_file.rb, line 13
    def initialize(path,options={},&block)
      @path = path

      super(options,&block)
    end

Public Instance Methods

each_word(&block) click to toggle source

Enumerates through every word in the flat-file, passing each word to the given block.

  flat_file.each_word do |word|
    puts word
  end
# File lib/wordlist/flat_file.rb, line 27
    def each_word(&block)
      File.open(@path) do |file|
        file.each_line do |line|
          yield line.chomp
        end
      end
    end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.