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

Example JSON #10

Open
Ivo-Balbaert opened this issue Mar 8, 2017 · 1 comment
Open

Example JSON #10

Ivo-Balbaert opened this issue Mar 8, 2017 · 1 comment

Comments

@Ivo-Balbaert
Copy link

result = String.build do |io|
io.json_object do |object|
object.field "address", "Crystal Road 1234"
object.field "location" do
io.json_array do |array|
array << 12.3
array << 34.5
end
end
end
end

Error: undefined method json_object for String::Builder

@firoxer
Copy link

firoxer commented Oct 9, 2018

This doesn't seem to relevant anymore as the original example has been changed:

result = JSON.build do |json|
json.object do
json.field "address", "Crystal Road 1234"
json.field "location" do
json.array do
json.number 12.3
json.number 34.5
end
end
end
end

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

No branches or pull requests

2 participants