Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Kernel#j
(*::_ToJson) -> nil
j(*objs)
ext/json/lib/json/common.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/ext/json/lib/json/common.rb, line 851
def j(*objs)
objs.each do |obj|
puts JSON::generate(obj, :allow_nan => true, :max_nesting => false)
end
nil
end
Outputs objs to STDOUT as JSON strings in the shortest form, that is in one line.