Sha256: dc385b17ee7f7aae30baad5d1cc640de567e0df84e501c9d6b5ae4abb19c7a8c

Contents?: true

Size: 633 Bytes

Versions: 59

Compression:

Stored size: 633 Bytes

Contents

module Dap
module Filter

module Base
  attr_accessor :name, :opts

  def initialize(args)
    self.opts = {}
    args.each do |arg|
        k,v = arg.split("=", 2)
        self.opts[k] = v
    end
    self.name = Dap::Factory.name_from_class(self.class)
  end

  def process(doc)
    raise RuntimeError, "No process() method defined for filter #{self.name}"
  end

end

module BaseDecoder
  include Base
  def process(doc)
    self.opts.each_pair do |k,v|
      next unless doc.has_key?(k)
      info = decode(doc[k]) || {}
      info.each_pair do |x,y|
        doc[ "#{k}.#{x}" ] = y
      end
    end
   [ doc ]
  end
end

end
end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
dap-0.0.19 lib/dap/filter/base.rb
dap-0.0.18 lib/dap/filter/base.rb
dap-0.0.17 lib/dap/filter/base.rb
dap-0.0.16 lib/dap/filter/base.rb
dap-0.0.15 lib/dap/filter/base.rb
dap-0.0.14 lib/dap/filter/base.rb
dap-0.0.13 lib/dap/filter/base.rb
dap-0.0.12 lib/dap/filter/base.rb
dap-0.0.11 lib/dap/filter/base.rb
dap-0.0.10 lib/dap/filter/base.rb
dap-0.0.9 lib/dap/filter/base.rb
dap-0.0.8 lib/dap/filter/base.rb
dap-0.0.7 lib/dap/filter/base.rb
dap-0.0.6 lib/dap/filter/base.rb
dap-0.0.5 lib/dap/filter/base.rb
dap-0.0.4 lib/dap/filter/base.rb
dap-0.0.3 lib/dap/filter/base.rb
dap-0.0.2 lib/dap/filter/base.rb
dap-0.0.1 lib/dap/filter/base.rb