Class: Strada::Adapter::YAML
- Inherits:
-
Object
- Object
- Strada::Adapter::YAML
- Defined in:
- lib/strada/adapter/yaml.rb
Class Method Summary collapse
-
.from(yaml) ⇒ Object
将 YAML 转换为 RUBY(HASH) 数据结构.
-
.to(hash) ⇒ Object
将 RUBY(HASH) 数据结构转换为 YAML.
Class Method Details
.from(yaml) ⇒ Object
将 YAML 转换为 RUBY(HASH) 数据结构
23 24 25 |
# File 'lib/strada/adapter/yaml.rb', line 23 def from(yaml) ::YAML.load yaml end |
.to(hash) ⇒ Object
将 RUBY(HASH) 数据结构转换为 YAML
19 20 21 |
# File 'lib/strada/adapter/yaml.rb', line 19 def to(hash) ::YAML.dump hash end |