Class: Lutaml::Model::TomlAdapter::TomlibAdapter

Inherits:
TomlDocument 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



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

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

Instance Method Details

#to_toml(*args) ⇒ Object



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

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