Module: Visor::Common::Extensions::YAML

Defined in:
lib/common/extensions/yaml.rb

Overview

Extending YAML library

Class Method Summary collapse

Class Method Details

.load_openstruct(source) ⇒ OpenStruct

Load a YAML source to to an OpenStruct object. Used for Hash.to_openstruct

Parameters:

  • source (YAML)

    A file or a parsed YAML object.

Returns:

  • (OpenStruct)

    YAML file parsed to an OpenStruct object.



20
21
22
# File 'lib/common/extensions/yaml.rb', line 20

def self.load_openstruct(source)
  self.load(source).to_openstruct
end