Sha256: df6c3a43ac3559321168e20f0207d8717366a67be2cd0c027732e43101b14c9c

Contents?: true

Size: 980 Bytes

Versions: 19

Compression:

Stored size: 980 Bytes

Contents

module Embulk
  module Filter

    class <%= ruby_class_name %> < FilterPlugin
      Plugin.register_filter(<%= name.dump %>, self)

      def self.transaction(config, in_schema, &control)
        # configuration code:
        task = {
          "option1" => config.param("option1", :integer),                     # integer, required
          "option2" => config.param("option2", :string, default: "myvalue"),  # string, optional
          "option3" => config.param("option3", :string, default: nil),        # string, optional
        }

        yield(task, out_columns)
      end

      def init
        # initialization code:
        @option1 = task["option1"]
        @option2 = task["option2"]
        @option3 = task["option3"]
      end

      def close
      end

      def add(page)
        # filtering code:
        page.each do |record|
          page_builder.add(record)
        end
      end

      def finish
        page_builder.finish
      end
    end

  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
embulk-0.6.27 lib/embulk/data/new/ruby/filter.rb.erb
embulk-0.7.3 lib/embulk/data/new/ruby/filter.rb.erb
embulk-0.7.3-java lib/embulk/data/new/ruby/filter.rb.erb
embulk-0.7.2 lib/embulk/data/new/ruby/filter.rb.erb
embulk-0.7.2-java lib/embulk/data/new/ruby/filter.rb.erb
embulk-0.6.26 lib/embulk/data/new/ruby/filter.rb.erb
embulk-0.7.1 lib/embulk/data/new/ruby/filter.rb.erb
embulk-0.7.1-java lib/embulk/data/new/ruby/filter.rb.erb
embulk-0.7.0 lib/embulk/data/new/ruby/filter.rb.erb
embulk-0.7.0-java lib/embulk/data/new/ruby/filter.rb.erb
embulk-0.6.25 lib/embulk/data/new/ruby/filter.rb.erb
embulk-0.6.24 lib/embulk/data/new/ruby/filter.rb.erb
embulk-0.6.23 lib/embulk/data/new/ruby/filter.rb.erb
embulk-0.6.22 lib/embulk/data/new/ruby/filter.rb.erb
embulk-0.6.21 lib/embulk/data/new/ruby/filter.rb.erb
embulk-0.6.20 lib/embulk/data/new/ruby/filter.rb.erb
embulk-0.6.19 lib/embulk/data/new/ruby/filter.rb.erb
embulk-0.6.18 lib/embulk/data/new/ruby/filter.rb.erb
embulk-0.6.17 lib/embulk/data/new/ruby/filter.rb.erb