Sha256: c2acbba4dd01a5f7ea0b6c70ef992ac4d797e7d0e77ed9773ed23f6e75271d72
Contents?: true
Size: 460 Bytes
Versions: 11
Compression:
Stored size: 460 Bytes
Contents
# frozen_string_literal: true module Cmdlet # Miscellaneous cmdlets module Misc # FormatJson: FormatJson will take an object and write it out as pretty JSON class FormatJson < Cmdlet::BaseCmdlet # # @param [Object] value - object to be converted to JSON string # @return [String] value as pretty JSON string def call(value) return '{}' if value.nil? JSON.pretty_generate(value) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems