Sha256: ef944ff69f368087d40f14011729c58ddfd438ed3fff0816b56580aef34e1fd9
Contents?: true
Size: 740 Bytes
Versions: 19
Compression:
Stored size: 740 Bytes
Contents
require "yaml" require_relative "yaml_document" module Lutaml module Model module YamlAdapter class StandardYamlAdapter < YamlDocument PERMITTED_CLASSES_BASE = [Date, Time, DateTime, Symbol, Hash, Array].freeze PERMITTED_CLASSES = if defined?(BigDecimal) PERMITTED_CLASSES_BASE + [BigDecimal] else PERMITTED_CLASSES_BASE end.freeze def self.parse(yaml) YAML.safe_load(yaml, permitted_classes: PERMITTED_CLASSES) end def to_yaml(options = {}) YAML.dump(@attributes, options) end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems