Class: Embulk::Input::HttpInputPlugin::IterJson
- Defined in:
- lib/embulk/input/http.rb
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(data, path) ⇒ IterJson
constructor
A new instance of IterJson.
Constructor Details
#initialize(data, path) ⇒ IterJson
Returns a new instance of IterJson.
148 149 150 151 152 |
# File 'lib/embulk/input/http.rb', line 148 def initialize(data, path) require "jsonpath" super @jsonpath = JsonPath.new(@path) end |
Instance Method Details
#each ⇒ Object
154 155 156 157 158 159 |
# File 'lib/embulk/input/http.rb', line 154 def each @jsonpath.on(@data).flatten.each do |e| raise "data is must be hash, but #{e.class}" unless e.instance_of?(Hash) yield e end end |