Module: YAMLInteraction

Included in:
Graph, HTML, Page, ScoreCollection
Defined in:
lib/html_compilation/modules/yaml_interaction.rb

Instance Method Summary collapse

Instance Method Details

#key_value_add(file_location, key, value) ⇒ Object



8
9
10
11
12
# File 'lib/html_compilation/modules/yaml_interaction.rb', line 8

def key_value_add(file_location, key, value)
  hash = return_yaml(file_location)
  hash.store(key.upcase.tr(' ', '_'), value.to_s)
  yaml_dump(file_location, hash)
end

#read_yaml(relative_location, data) ⇒ Object



4
5
6
# File 'lib/html_compilation/modules/yaml_interaction.rb', line 4

def read_yaml(relative_location, data)
  return_yaml(relative_location)[data.upcase.tr(' ', '_')]
end