Class: Lutaml::JsonLd::Adapter
- Inherits:
-
KeyValue::Document
- Object
- KeyValue::Document
- Lutaml::JsonLd::Adapter
- Defined in:
- lib/lutaml/jsonld/adapter.rb
Instance Attribute Summary
Attributes inherited from KeyValue::Document
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from KeyValue::Document
#[], #[]=, #initialize, #key?, #to_h
Constructor Details
This class inherits a constructor from Lutaml::KeyValue::Document
Class Method Details
.parse(jsonld_string, _options = {}) ⇒ Object
8 9 10 |
# File 'lib/lutaml/jsonld/adapter.rb', line 8 def self.parse(jsonld_string, = {}) JSON.parse(jsonld_string, create_additions: false) end |
Instance Method Details
#to_jsonld(*args) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/lutaml/jsonld/adapter.rb', line 12 def to_jsonld(*args) = args.first || {} data = @attributes if [:pretty] JSON.pretty_generate(data, *args) else JSON.generate(data, *args) end end |