Class: Cmdlet::Misc::FormatJson
- Inherits:
-
BaseCmdlet
- Object
- BaseCmdlet
- Cmdlet::Misc::FormatJson
- Defined in:
- lib/cmdlet/misc/format_json.rb
Overview
FormatJson: FormatJson will take an object and write it out as pretty JSON
Instance Method Summary collapse
-
#call(value) ⇒ String
Value as pretty JSON string.
Methods inherited from BaseCmdlet
Instance Method Details
#call(value) ⇒ String
Returns value as pretty JSON string.
11 12 13 14 15 |
# File 'lib/cmdlet/misc/format_json.rb', line 11 def call(value) return '{}' if value.nil? JSON.pretty_generate(value) end |