Class: Norikra::Client::CLIUtil::Formatter::JSON
- Inherits:
-
Object
- Object
- Norikra::Client::CLIUtil::Formatter::JSON
- Defined in:
- lib/norikra/client/cli/formatter.rb
Instance Method Summary collapse
- #format(obj) ⇒ Object
-
#initialize(*args) ⇒ JSON
constructor
A new instance of JSON.
Constructor Details
#initialize(*args) ⇒ JSON
Returns a new instance of JSON.
18 19 20 |
# File 'lib/norikra/client/cli/formatter.rb', line 18 def initialize(*args) require 'json' end |
Instance Method Details
#format(obj) ⇒ Object
21 22 23 |
# File 'lib/norikra/client/cli/formatter.rb', line 21 def format(obj) ::JSON.dump(obj) end |