Class: Embulk::Page
Overview
TODO pure-ruby page reader
Instance Attribute Summary collapse
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(java_page, schema) ⇒ Page
constructor
A new instance of Page.
Constructor Details
#initialize(java_page, schema) ⇒ Page
Returns a new instance of Page.
9 10 11 12 |
# File 'lib/embulk/page.rb', line 9 def initialize(java_page, schema) @java_page = java_page @schema = schema end |
Instance Attribute Details
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
14 15 16 |
# File 'lib/embulk/page.rb', line 14 def schema @schema end |
Instance Method Details
#each ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/embulk/page.rb', line 16 def each schema = @schema reader = Java::PageReader.new(schema.to_java) begin reader.setPage(@java_page) while reader.nextRecord yield schema.read_record(reader) end ensure reader.close end end |