Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

derive Enumerable #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

derive Enumerable #3

wants to merge 1 commit into from

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