Skip to content

bindata translator improvements (make Ruby code more idiomatic and simpler) - #29

Merged
scrapper merged 3 commits into
scrapper:masterfrom
pvdb:bindata_translator_improvements
Jul 28, 2024
Merged

bindata translator improvements (make Ruby code more idiomatic and simpler)#29
scrapper merged 3 commits into
scrapper:masterfrom
pvdb:bindata_translator_improvements

Conversation

@pvdb

@pvdb pvdb commented Jul 4, 2024

Copy link
Copy Markdown
Contributor

Minor change to the BDFieldNameTranslator#to_bd_field_name method, by making the BD_DICT lookup slightly more idiomatic: instead of using Hash#[] it now uses Hash#fetch with the original name of the lookup key as the default value, meaning that if it doesn't appear in the BD_DICT hash, the lookup key will be returned unchanged.

To verify that this refactor is functionally equivalent to the original implementation, I have also included a spec for the BDFieldNameTranslator module, which runs "green" on both the master branch, as well as on the feature branch for this pull request.

Thanks, @scrapper! 🙏

@scrapper
scrapper merged commit c7a108d into scrapper:master Jul 28, 2024
@scrapper

Copy link
Copy Markdown
Owner

Thanks for submitting your improvement!

@pvdb
pvdb deleted the bindata_translator_improvements branch July 28, 2024 19:53
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.

2 participants