Class: Yarrow::Format::Yaml
- Inherits:
-
Object
- Object
- Yarrow::Format::Yaml
- Includes:
- Methods::Metadata
- Defined in:
- lib/yarrow/format/yaml.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(source) ⇒ Yaml
constructor
A new instance of Yaml.
- #to_h ⇒ Object
Methods included from Methods::Metadata
Constructor Details
#initialize(source) ⇒ Yaml
Returns a new instance of Yaml.
6 7 8 |
# File 'lib/yarrow/format/yaml.rb', line 6 def initialize(source) @data = YAML.load(source, symbolize_names: true) end |
Instance Method Details
#[](key) ⇒ Object
10 11 12 |
# File 'lib/yarrow/format/yaml.rb', line 10 def [](key) @data[key] end |
#to_h ⇒ Object
14 15 16 |
# File 'lib/yarrow/format/yaml.rb', line 14 def to_h @data end |