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

Introduce visitor bind #360

Open
TobiasNx opened this issue Jul 2, 2024 · 0 comments
Open

Introduce visitor bind #360

TobiasNx opened this issue Jul 2, 2024 · 0 comments

Comments

@TobiasNx
Copy link
Collaborator

TobiasNx commented Jul 2, 2024

from Catmandu Cheat Sheet:

visitor([path:JSONPath])

Execute all fixes in the context of every
element in the data. This fix will set
special context variables:
scalar - for every scalar value found
array - for every array value found
hash - for every hash value found
key - the field name on which the scalar
array or hash is found

# upcast every ‘name’ field in the record
do visitor()
	if all_equal(key,name)
		upcase(scalar)
	end
end

This would make #162 obsolete and would be a more generic approach.l

@TobiasNx TobiasNx changed the title Introduce visitor bind Introduce visitor bind Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants