Class: ConfigSL::FileFormat::Yaml

Inherits:
Base
  • Object
show all
Defined in:
lib/configsl/file_format/yaml.rb

Overview

Support for YAML files.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from ConfigSL::FileFormat::Base

Class Method Details

.extensionsObject



11
12
13
# File 'lib/configsl/file_format/yaml.rb', line 11

def self.extensions
  i[yaml yml]
end

Instance Method Details

#readObject



15
16
17
18
19
# File 'lib/configsl/file_format/yaml.rb', line 15

def read
  ::YAML.load_file(@file, symbolize_names: true).each do |name, value|
    yield name, value if block_given?
  end
end