module Xenon::QuotedString
Public Instance Methods
quote()
click to toggle source
# File lib/xenon/quoted_string.rb, line 4 def quote qs = gsub(/([\\"])/, '\\\\\1') self == qs ? self : %{"#{qs}"} end
uncomment()
click to toggle source
# File lib/xenon/quoted_string.rb, line 14 def uncomment qs = start_with?('(') && end_with?(')') ? self[1..-2] : self qs.gsub(/\\(.)/, '\1') end
unquote()
click to toggle source
# File lib/xenon/quoted_string.rb, line 9 def unquote qs = start_with?('"') && end_with?('"') ? self[1..-2] : self qs.gsub(/\\(.)/, '\1') end