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