Class: Yarrow::Format::Yaml

Inherits:
Object
  • Object
show all
Includes:
Methods::Metadata
Defined in:
lib/yarrow/format/yaml.rb

Instance Method Summary collapse

Methods included from Methods::Metadata

included

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_hObject



14
15
16
# File 'lib/yarrow/format/yaml.rb', line 14

def to_h
  @data
end