Class: BEL::Extension::Format::JSONImplementation::JSONReader
- Inherits:
-
Object
- Object
- BEL::Extension::Format::JSONImplementation::JSONReader
- Defined in:
- lib/bel/extensions/json/oj.rb,
lib/bel/extensions/json/jrjackson.rb,
lib/bel/extensions/json/ruby_json.rb,
lib/bel/extensions/json/multi_json.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(data) ⇒ JSONReader
constructor
A new instance of JSONReader.
Constructor Details
#initialize(data) ⇒ JSONReader
Returns a new instance of JSONReader.
7 8 9 |
# File 'lib/bel/extensions/json/oj.rb', line 7 def initialize(data) @data = data end |
Instance Method Details
#each(&block) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/bel/extensions/json/oj.rb', line 11 def each(&block) if block_given? Oj.sc_parse(EvidenceHandler.new(block), @data, :symbol_keys => true) else to_enum(:each) end end |