Class: Embulk::Input::FreeeGithub
- Inherits:
-
InputPlugin
- Object
- InputPlugin
- Embulk::Input::FreeeGithub
- Defined in:
- lib/embulk/input/freee_github.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#init ⇒ Object
TODO def self.guess(config) sample_records = [ “column”=>1, “value”=>0.1, “column”=>2, “value”=>0.2, ] columns = Guess::SchemaGuess.from_hash_records(sample_records) return => columns end.
- #run ⇒ Object
Class Method Details
.resume(task, columns, count, &control) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/embulk/input/freee_github.rb', line 24 def self.resume(task, columns, count, &control) task_reports = yield(task, columns, count) next_config_diff = {} return next_config_diff end |
.transaction(config, &control) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/embulk/input/freee_github.rb', line 7 def self.transaction(config, &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 } columns = [ Column.new(0, "example", :string), Column.new(1, "column", :long), Column.new(2, "value", :double), ] resume(task, columns, 1, &control) end |
Instance Method Details
#init ⇒ Object
TODO def self.guess(config)
sample_records = [
{"example"=>"a", "column"=>1, "value"=>0.1},
{"example"=>"a", "column"=>2, "value"=>0.2},
]
columns = Guess::SchemaGuess.from_hash_records(sample_records)
return {"columns" => columns}
end
41 42 43 44 45 46 |
# File 'lib/embulk/input/freee_github.rb', line 41 def init # initialization code: @option1 = task["option1"] @option2 = task["option2"] @option3 = task["option3"] end |
#run ⇒ Object
48 49 50 51 52 53 54 55 |
# File 'lib/embulk/input/freee_github.rb', line 48 def run page_builder.add(["example-value", 1, 0.1]) page_builder.add(["example-value", 2, 0.2]) page_builder.finish task_report = {} return task_report end |