Class: Lutaml::Store::Format::Json

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

Instance Method Summary collapse

Methods inherited from Base

#deserialize_many, #serialize_many

Instance Method Details

#deserialize(data, model_class) ⇒ Object



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

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

#extensionObject



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

def extension
  ".json"
end

#glob_patternObject



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

def glob_pattern
  "*.json"
end

#serialize(model) ⇒ Object



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

def serialize(model)
  model.to_json
end