Class: YamlStudentsListFormatStrategy
- Inherits:
-
StudentsListFormatStrategy
- Object
- StudentsListFormatStrategy
- YamlStudentsListFormatStrategy
- Defined in:
- lib/model_gem_source/students_list_format_strategy.rb
Instance Method Summary collapse
Instance Method Details
#read_from(filename) ⇒ Object
48 49 50 |
# File 'lib/model_gem_source/students_list_format_strategy.rb', line 48 def read_from(filename) YAML.load_file(filename) end |
#write_to(filename, students) ⇒ Object
52 53 54 55 56 |
# File 'lib/model_gem_source/students_list_format_strategy.rb', line 52 def write_to(filename, students) File.open(filename, 'w') do |file| file.write(students.to_yaml) end end |