Class: Norikra::Client::CLIUtil::Formatter::JSON

Inherits:
Object
  • Object
show all
Defined in:
lib/norikra/client/cli/formatter.rb

Instance Method Summary collapse

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