Class: ConverterYAML

Inherits:
Converter show all
Defined in:
lib/source/Converter_yaml.rb

Instance Method Summary collapse

Instance Method Details

#read_file(file_content) ⇒ Object



6
7
8
# File 'lib/source/Converter_yaml.rb', line 6

def read_file(file_content)
	YAML.safe_load(file_content).map{ |h| h.transform_keys(&:to_sym)}
end

#write_file(hash_students) ⇒ Object



10
11
12
# File 'lib/source/Converter_yaml.rb', line 10

def write_file(hash_students)
	YAML.dump(hash_students.map{ |h| h.transform_keys(&:to_s)})
end