Sha256: ecb94e44a692bfb8d3c9948510097f9ada38c4e13a64a7ba8579674e3c6f8034
Contents?: true
Size: 413 Bytes
Versions: 2
Compression:
Stored size: 413 Bytes
Contents
# frozen_string_literal: true require_relative 'student_list_strategy' require 'yaml' require 'json' class StudentListYaml<StudentListStrategy public_class_method :new #переопределили методы def string_to_list(str) YAML.safe_load(str).map {|h| h.transform_keys(&:to_sym)} end def list_to_string(list) list.map { |h| h.transform_keys(&:to_s)}.to_yaml end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rafmycat-1.0.1 | lib/source/strategy/students_list_yaml.rb |
rafmycat-1.0.0 | lib/source/strategy/students_list_yaml.rb |