Sha256: b5acf7971bf19caf5849f7a2c89293b5fb3e407a1e56285a27b3039f71e94aaa

Contents?: true

Size: 543 Bytes

Versions: 15

Compression:

Stored size: 543 Bytes

Contents

# >> x = "hello\n\t\\l\"world\""
# => "hello\n\t\\l\"world\""
# >> puts x.inspect.gsub( "\\\\", "\\" )
# "hello\n\t\l\"world\""
#
# OR
# 
# >> x = 'hello\n\t\l"world"'
# => "hello\\n\\t\\l\"world\""
# >> puts x.inspect.gsub( "\\\\", "\\" )
# "hello\n\t\l\"world\""


class GraphViz
  class Types
    class EscString < Common
      def check(data)
        return data
      end
      
      def output
        return @data.to_s.inspect.gsub( "\\\\", "\\" )
      end
      
      alias :to_gv :output
      alias :to_s :output
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ruby-graphviz-1.0.0 lib/graphviz/types/esc_string.rb
ruby-graphviz-0.9.21 lib/graphviz/types/esc_string.rb
ruby-graphviz-0.9.20 lib/graphviz/types/esc_string.rb
ruby-graphviz-0.9.19 lib/graphviz/types/esc_string.rb
ruby-graphviz-0.9.18 lib/graphviz/types/esc_string.rb
ruby-graphviz-0.9.17 lib/graphviz/types/esc_string.rb
ruby-graphviz-0.9.16 lib/graphviz/types/esc_string.rb
ruby-graphviz-0.9.15 lib/graphviz/types/esc_string.rb
ruby-graphviz-0.9.14 lib/graphviz/types/esc_string.rb
ruby-graphviz-0.9.13 lib/graphviz/types/esc_string.rb
ruby-graphviz-0.9.12 lib/graphviz/types/esc_string.rb
ruby-graphviz-0.9.11 lib/graphviz/types/esc_string.rb
ruby-graphviz-0.9.10 lib/graphviz/types/esc_string.rb
ruby-graphviz-0.9.9 lib/graphviz/types/esc_string.rb
ruby-graphviz-0.9.8 lib/graphviz/types/esc_string.rb