Class: Lutaml::KeyValue::Adapter::Yamls::StandardAdapter
- Defined in:
- lib/lutaml/key_value/adapter/yamls/standard_adapter.rb
Constant Summary collapse
- FORMAT_SYMBOL =
:yamls
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Document
Constructor Details
This class inherits a constructor from Lutaml::KeyValue::Adapter::Yamls::Document
Class Method Details
.parse(yamls, _options = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/lutaml/key_value/adapter/yamls/standard_adapter.rb', line 12 def self.parse(yamls, = {}) results = [] yamls.split(/^---\n/).each do |yaml| next if yaml.strip.empty? begin results << YAML.safe_load(yaml, aliases: true) rescue Psych::SyntaxError => e warn "Skipping invalid yaml: #{e.}" end end results end |