
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
= DocWrapper
This project rocks and uses MIT-LICENSE.
== Description
Doc wrapper, convert a doc in another doc. Doc is some ruby data structure, like a Hash, Array or a simple String
The advantage is that the conversion engine is automatically identified, making the code cleaner
===== Example
:001 > DocWrapper.to_target_doc {origin: :sales, user_id: 1, account_id: 99 }
=> { user: 'John', account_name: 'xxxx' }
another example, only changes de origin key :002 > DocWrapper.to_target_doc {owner: :billing, user_id: 1, account_id: 99 } ==> { user_name: 'john', amount: 100.87 }
== Install
$ gem install ds_doc_wrapper
== Usage
First you need define some doc wrappers
class DocWrapper::DocByTomCat def self.to_target_doc a_doc # -- here put you converter code { tom_cat_name: a_doc['name'], tom_cat_eat: a_doc['food'] } end end
another doc wrapper:
class DocWrapper::DocByCook def self.to_target_doc a_doc # -- here put you converter code { name: a_doc['name'], main: a_doc['food'] } end end
them: :003 > DocWrapper::Base.to_target_doc( { owner: 'tom_cat', 'name' => 'Tom', 'food' => 'fish' } ) ==> { tom_cat_name: 'Tom', tom_cat_eat: 'fish' }
:004 > DocWrapper::Base.to_target_doc( { owner: 'cook', 'name' => 'Tom', 'food' => 'fish' } )
==> { name: 'Tom', main: 'fish' }
== Change log
FAQs
Unknown package
We found that ds_doc_wrapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.