Method: String#ruby_encode

Defined in:
lib/ronin/support/encoding/ruby/core_ext/string.rb

#ruby_encodeString

Ruby escapes every character in the String.

Examples:

"hello".ruby_encode
# => "\\x68\\x65\\x6c\\x6c\\x6f"

Returns:

  • (String)

    The Ruby escaped String.

See Also:

Since:

  • 1.0.0



83
84
85
# File 'lib/ronin/support/encoding/ruby/core_ext/string.rb', line 83

def ruby_encode
  Ronin::Support::Encoding::Ruby.encode(self)
end