Sha256: 65fbac125d5a950212036022efdcddde0b08799642feb77d361397c79cd0aa44

Contents?: true

Size: 405 Bytes

Versions: 12

Compression:

Stored size: 405 Bytes

Contents

module Kernel
  # Outputs _objs_ to STDOUT as JSON strings in the shortest form, that is in
  # one line.
  def j(*objs)
    objs.each do |obj|
      puts JSON::unparse(obj)
    end
    nil
  end

  # Ouputs _objs_ to STDOUT as JSON strings in a pretty format, with
  # indentation and over many lines.
  def jj(*objs)
    objs.each do |obj|
      puts JSON::pretty_unparse(obj)
    end
    nil
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
fjson-0.0.1 lib/extensions/kernel.rb
fjson-0.0.4 lib/extensions/kernel.rb
fjson-0.0.7 lib/extensions/kernel.rb
fjson-0.0.8 lib/extensions/kernel.rb
fjson-0.1.2 lib/extensions/kernel.rb
fjson-0.0.3 lib/extensions/kernel.rb
fjson-0.0.5 lib/extensions/kernel.rb
fjson-0.0.6 lib/extensions/kernel.rb
fjson-0.0.9 lib/extensions/kernel.rb
fjson-0.1.0 lib/extensions/kernel.rb
fjson-0.0.2 lib/extensions/kernel.rb
fjson-0.1.1 lib/extensions/kernel.rb