Class: Lutaml::Model::TomlAdapter::TomlibDocument

Inherits:
Document show all
Defined in:
lib/lutaml/model/toml_adapter/tomlib_adapter.rb

Instance Attribute Summary

Attributes inherited from TomlObject

#attributes

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TomlObject

#[], #[]=, #initialize, #to_h

Constructor Details

This class inherits a constructor from Lutaml::Model::TomlAdapter::TomlObject

Class Method Details

.parse(toml) ⇒ Object



9
10
11
12
# File 'lib/lutaml/model/toml_adapter/tomlib_adapter.rb', line 9

def self.parse(toml)
  data = Tomlib.load(toml)
  new(data)
end

Instance Method Details

#to_toml(*args) ⇒ Object



14
15
16
17
# File 'lib/lutaml/model/toml_adapter/tomlib_adapter.rb', line 14

def to_toml(*args)
  Tomlib.dump(to_h, *args)
  # Tomlib::Generator.new(to_h).toml_str
end