Class: TTY::Config::Marshallers::INIMarshaller

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

Instance Method Summary collapse

Methods included from TTY::Config::Marshaller

included

Instance Method Details

#marshal(object) ⇒ Object


16
17
18
# File 'lib/tty/config/marshallers/ini_marshaller.rb', line 16

def marshal(object)
  TTY::Config::Generator.generate(object)
end

#unmarshal(content) ⇒ Object


20
21
22
23
24
# File 'lib/tty/config/marshallers/ini_marshaller.rb', line 20

def unmarshal(content)
  ini = IniFile.new(content: content).to_h
  global = ini.delete('global')
  ini.merge!(global)
end