lib/strada/adapter/toml.rb in strada-0.0.3 vs lib/strada/adapter/toml.rb in strada-0.0.4

- old
+ new

@@ -11,17 +11,17 @@ class Adapter class TOML # 定义类方法 class << self - require "toml" - # 将 RUBY(HASH) 数据结构转换为 TOML def to(hash) + require "toml" ::TOML::Generator.new(hash).body end # 将 TOML 转换为 RUBY 数据结构 def from(toml) + require "toml" ::TOML.load toml end end end end