Sha256: 76452328acee6294433230b9e69729039de1b92307d895812ff15ad9758522f8

Contents?: true

Size: 482 Bytes

Versions: 4

Compression:

Stored size: 482 Bytes

Contents

require "yaml"
require_relative "yaml_document"

module Lutaml
  module Model
    module YamlAdapter
      class StandardYamlAdapter < YamlDocument
        def self.parse(yaml)
          YAML.safe_load(
            yaml,
            permitted_classes: [Date, Time, DateTime, Symbol,
                                BigDecimal, Hash, Array],
          )
        end

        def to_yaml(options = {})
          YAML.dump(@attributes, options)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lutaml-model-0.3.10 lib/lutaml/model/yaml_adapter/standard_yaml_adapter.rb
lutaml-model-0.3.9 lib/lutaml/model/yaml_adapter/standard_yaml_adapter.rb
lutaml-model-0.3.8 lib/lutaml/model/yaml_adapter/standard_yaml_adapter.rb
lutaml-model-0.3.7 lib/lutaml/model/yaml_adapter/standard_yaml_adapter.rb