Class: Tb::JSONReader

Inherits:
HashReader show all
Defined in:
lib/tb/json.rb

Instance Method Summary collapse

Methods inherited from HashReader

#get_hash, #get_named_header, #header_and_each, #header_known?, #update_header

Methods included from EnumerableWithEach

#each

Methods included from Enumerable

#cat, #extsort_by, #natjoin2, #natjoin2_outer, #newfield, #to_fileenumerator, #with_cumulative_header, #with_header, #write_to_csv, #write_to_json, #write_to_ltsv, #write_to_pnm, #write_to_tsv, #write_with

Constructor Details

#initialize(io) ⇒ JSONReader

Returns a new instance of JSONReader.



33
34
35
36
# File 'lib/tb/json.rb', line 33

def initialize(io)
  ary = JSON.parse(io.read)
  super lambda { ary.shift }
end