Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/clj/types.rb

Instance Method Summary collapse

Instance Method Details

#to_clj(options = {}) ⇒ Object



99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/clj/types.rb', line 99

def to_clj (options = {})
	result = if respond_to? :encode
		encode('UTF-16be').inspect
	else
		inspect
	end
	
	result.gsub!(/(^|[^\\])\\e/, '\1\u001b')
	result.gsub!(/(^|[^\\])\\a/, '\1\u0003')

	result
end