Module: EDN::CoreExt::String

Defined in:
lib/edn/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#to_ednObject



36
37
38
39
40
41
42
43
44
45
# File 'lib/edn/core_ext.rb', line 36

def to_edn
  array = chars.map do |ch|
    if %w{" \\}.include?(ch)
      '\\' + ch
    else
      ch
    end
  end
  '"' + array.join + '"'
end

#~@Object



32
33
34
# File 'lib/edn/core_ext.rb', line 32

def ~@
  EDN::Type::Symbol.new(self)
end