class ApacheCrunch::ProcedureRoutine

Abstract for a procedure routine.

Public Class Methods

new(log_parser) click to toggle source
# File lib/procedure_dsl.rb, line 6
def initialize(log_parser)
    @_log_parser = log_parser
    @_current_entry = nil
end

Public Instance Methods

execute(&blk) click to toggle source

Executes the DSL routine using the given block

Abstract method

# File lib/procedure_dsl.rb, line 19
def execute(&blk)
    raise "Not implemented"
end
finish() click to toggle source

Anything that needs to happen after the routine completes but before it returns its result can go in here.

# File lib/procedure_dsl.rb, line 25
def finish
    @_log_parser.reset_file!
end
method_missing(sym, *args) click to toggle source

Allows blocks passed to a DSL routine to access parameters from the current log entry

# File lib/procedure_dsl.rb, line 12
def method_missing(sym, *args)
    @_current_entry.fetch(sym)
end