Module: YamlStrings

Defined in:
lib/yaml_strings.rb,
lib/yaml_strings/version.rb

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.strings_to_yaml(string_file) ⇒ Object



13
14
15
16
# File 'lib/yaml_strings.rb', line 13

def strings_to_yaml(string_file)
  strings_array = File.readlines(string_file)
  StringsToYamlEncoder.new(strings_array).to_s
end

.yaml_to_strings(yaml_file) ⇒ Object



8
9
10
11
# File 'lib/yaml_strings.rb', line 8

def yaml_to_strings(yaml_file)
  yaml_hash = YAML.load(File.open(yaml_file))
  YamlToStringsEncoder.new(yaml_hash).to_s
end