Sha256: 06966262a4514d3137cd98577002b62c7b26cda631cc2d5474602595fedfa456
Contents?: true
Size: 365 Bytes
Versions: 12
Compression:
Stored size: 365 Bytes
Contents
# frozen_string_literal: true require_relative 'data_transformer_base' require 'yaml' class DataTransformerYAML < DataTransformerBase public_class_method :new def str_to_hash_list(str) YAML.safe_load(str).map { |h| h.transform_keys(&:to_sym) } end def hash_list_to_str(hash_list) hash_list.map { |h| h.transform_keys(&:to_s) }.to_yaml end end
Version data entries
12 entries across 12 versions & 5 rubygems