Class: Lutaml::Store::Format::Yaml

Inherits:
Base
  • Object
show all
Defined in:
lib/lutaml/store/format/yaml.rb

Instance Method Summary collapse

Methods inherited from Base

#serialize_many

Instance Method Details

#deserialize(data, model_class) ⇒ Object



19
20
21
# File 'lib/lutaml/store/format/yaml.rb', line 19

def deserialize(data, model_class)
  model_class.from_yaml(data)
end

#deserialize_many(data, model_class) ⇒ Object



23
24
25
# File 'lib/lutaml/store/format/yaml.rb', line 23

def deserialize_many(data, model_class)
  model_class.from_yamls(data)
end

#extensionObject



7
8
9
# File 'lib/lutaml/store/format/yaml.rb', line 7

def extension
  ".yaml"
end

#glob_patternObject



11
12
13
# File 'lib/lutaml/store/format/yaml.rb', line 11

def glob_pattern
  "*.{yaml,yml}"
end

#serialize(model) ⇒ Object



15
16
17
# File 'lib/lutaml/store/format/yaml.rb', line 15

def serialize(model)
  model.to_yaml
end