Sha256: c29b3cd8d63b39a0fdd3be986377e398c41912c3df53fcea35cc765ddcaeda20

Contents?: true

Size: 723 Bytes

Versions: 2

Compression:

Stored size: 723 Bytes

Contents

module Alf
  class Reader
    #
    # Specialization of the Reader contrat for .alf files.
    #
    # A .alf file simply contains a query expression in the Lispy DSL. This
    # reader decodes and compiles the expression and delegates the enumeration
    # to the obtained operator.
    #
    # Note that an Environment must be wired at creation or piping time. 
    # NoSuchDatasetError will certainly occur otherwise.  
    #
    class AlfFile < Reader
      
      # (see Reader#each)
      def each
        op = Alf.lispy(environment).compile(input_text, input_path)
        op.each(&Proc.new)
      end
      
      Reader.register(:alf, [".alf"], self)
    end # module AlfFile
  end # class Reader
end # module Alf

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alf-0.10.1 lib/alf/reader/alf_file.rb
alf-0.10.0 lib/alf/reader/alf_file.rb