Class: TTY::Config::Marshallers::JSONMarshaller

Inherits:
Object
  • Object
show all
Includes:
TTY::Config::Marshaller
Defined in:
lib/tty/config/marshallers/json_marshaller.rb

Overview

Responsible for marshalling content from and into JSON format

Instance Method Summary collapse

Methods included from TTY::Config::Marshaller

included

Instance Method Details

#marshal(object) ⇒ Object



18
19
20
# File 'lib/tty/config/marshallers/json_marshaller.rb', line 18

def marshal(object)
  JSON.pretty_generate(object)
end

#unmarshal(content) ⇒ Object



22
23
24
# File 'lib/tty/config/marshallers/json_marshaller.rb', line 22

def unmarshal(content)
  JSON.parse(content)
end