Class: StudentListYaml

Inherits:
StudentListStrategy show all
Defined in:
lib/source/strategy/students_list_yaml.rb

Instance Method Summary collapse

Instance Method Details

#list_to_string(list) ⇒ Object



15
16
17
18
19
# File 'lib/source/strategy/students_list_yaml.rb', line 15

def list_to_string(list)
  list.map {
    |h|
    h.transform_keys(&:to_s)}.to_yaml
end

#string_to_list(str) ⇒ Object

переопределили методы



11
12
13
# File 'lib/source/strategy/students_list_yaml.rb', line 11

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