class ParseDecision::Plugin::Plugin

#######################################################################

Base class for all plugins

Public Class Methods

new() click to toggle source
# File lib/parse_decision/plugin/plugin.rb, line 19
def initialize()
  $LOG.debug "Plugin::initialize"
end

Public Instance Methods

apply_template(template, pattern, replacement) click to toggle source
# File lib/parse_decision/plugin/plugin.rb, line 23
def apply_template(template, pattern, replacement)
  output = template.gsub(pattern, replacement)
end
apply_templates(template, repPatterns) click to toggle source
# File lib/parse_decision/plugin/plugin.rb, line 27
def apply_templates(template, repPatterns)
  output = template
  repPatterns.each do |p,r|
    output = output.gsub(p, r)
  end # repPatterns.each
  output
end
execute(context, ln) click to toggle source
# File lib/parse_decision/plugin/plugin.rb, line 35
def execute(context, ln)
 $LOG.debug "Plugin::execute"
  return false
end
write_to_file(f,data) click to toggle source
# File lib/parse_decision/plugin/plugin.rb, line 40
def write_to_file(f,data)
  if(data.class == Array)
    data.each do |ln|
      f.write ln
    end
  else
    f.write data
  end
end