Class: Strada::Adapter::TOML

Inherits:
Object
  • Object
show all
Defined in:
lib/strada/adapter/toml.rb

Class Method Summary collapse

Class Method Details

.from(toml) ⇒ Object

将 TOML 转换为 RUBY 数据结构



23
24
25
# File 'lib/strada/adapter/toml.rb', line 23

def from(toml)
  ::TOML.load toml
end

.to(hash) ⇒ Object

将 RUBY(HASH) 数据结构转换为 TOML



19
20
21
# File 'lib/strada/adapter/toml.rb', line 19

def to(hash)
  ::TOML::Generator.new(hash).body
end