Sha256: 072f1bd3e4e4e94cca624b6246993bdd49a341406331d8e5ddad81a6d01ec371

Contents?: true

Size: 522 Bytes

Versions: 3

Compression:

Stored size: 522 Bytes

Contents

# Used in primitive.citrus
module TomlString
  def value
    aux = first.value
    s = 0
    o = []
    while s < aux.length
      if aux[s] == "\\"
        s += 1
        case aux[s]
        when "t" then o << "\t"
        when "n" then o << "\n"
        when "\\" then o << "\\"
        when '"' then o << '"'
        when "r" then o << "\r"
        when "0" then o << "\0"
        else
          o << '\\' << aux[s]
        end
      else
        o << aux[s]
      end
      s += 1
    end
    o[1...-1].join
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
toml-rb-0.1.2 lib/toml/string.rb
toml-rb-0.1.0 lib/toml/string.rb
toml_parser-ruby-0.1.0 lib/toml/string.rb