Module: Tk::CoreExtensions::String

Defined in:
lib/ffi-tk/core_extensions.rb

Instance Method Summary collapse

Instance Method Details

#to_tclObject



100
101
102
# File 'lib/ffi-tk/core_extensions.rb', line 100

def to_tcl
  TclString.new('"' << gsub(/[\[\]{}$"\\]/, '\\\\\&') << '"')
end

#to_tcl_optionObject



104
105
106
# File 'lib/ffi-tk/core_extensions.rb', line 104

def to_tcl_option
  TclString.new(sub(/\A(?=[^-])/, '-'))
end