Skip to content

Conversation

@gemmaro
Copy link

@gemmaro gemmaro commented Sep 3, 2022

Since the each method is already defined, we may include the Enumerable module.
Then the following methods will be derived:

irb(main):007:0> ndjson = NDJSON::Parser.new('sample.ndjson')
=> #<NDJSON::Parser:0x000000010535d058 @input=#<File:sample.ndjson>>
irb(main):008:0> ndjson.first
=> {"some"=>"thing"}
irb(main):009:0> ndjson.find { _1.size == 3 }
=> {"foo"=>17, "bar"=>false, "quux"=>true}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant