module YamlWaml

Public Class Methods

decode(orig_yamled) click to toggle source
# File lib/generators/i18n_translation/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

Private Instance Methods

decode(orig_yamled) click to toggle source
# File lib/generators/i18n_translation/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