class OpenConfig::YAML

Private Instance Methods

build_json(file_content) click to toggle source
# File lib/open_config/files/yaml.rb, line 15
def build_json(file_content)
  ::YAML.safe_load(load_erb(file_content)).to_json
end
load_erb(file_content) click to toggle source
# File lib/open_config/files/yaml.rb, line 19
def load_erb(file_content)
  ::ERB.new(file_content).result
end
parse_file(file_content) click to toggle source
# File lib/open_config/files/yaml.rb, line 11
def parse_file(file_content)
  ::JSON.parse(build_json(file_content), object_class: OpenStruct)
end