Sha256: c4f4b4567ae5dce9a284e1fa61e00b1e990ee87c7724becdc9a44169f9427db8

Contents?: true

Size: 407 Bytes

Versions: 7

Compression:

Stored size: 407 Bytes

Contents

require "tomlib"
require_relative "toml_document"

module Lutaml
  module Model
    module TomlAdapter
      class TomlibAdapter < TomlDocument
        def self.parse(toml, _options = {})
          data = Tomlib.load(toml)
          new(data)
        end

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
lutaml-model-0.5.4 lib/lutaml/model/toml_adapter/tomlib_adapter.rb
lutaml-model-0.5.3 lib/lutaml/model/toml_adapter/tomlib_adapter.rb
lutaml-model-0.5.2 lib/lutaml/model/toml_adapter/tomlib_adapter.rb
lutaml-model-0.5.1 lib/lutaml/model/toml_adapter/tomlib_adapter.rb
lutaml-model-0.5.0 lib/lutaml/model/toml_adapter/tomlib_adapter.rb
lutaml-model-0.4.0 lib/lutaml/model/toml_adapter/tomlib_adapter.rb
lutaml-model-0.3.30 lib/lutaml/model/toml_adapter/tomlib_adapter.rb