Module: YamlWaml

Defined in:
lib/yaml_waml.rb

Class Method Summary collapse

Class Method Details

.decode(orig_yamled) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/yaml_waml.rb', line 10

def decode(orig_yamled)
  yamled_str = case orig_yamled
               when String then orig_yamled
               when StringIO then orig_yamled.string
               else return orig_yamled
               end
  yamled_str.gsub!(/\\x(\w{2})/){[$1].pack("H2")}
  return yamled_str
end