Module: Tk::CoreExtensions::String

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

Instance Method Summary collapse

Instance Method Details

#to_tclObject



73
74
75
# File 'lib/ffi-tk/core_extensions.rb', line 73

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

#to_tcl_optionObject



77
78
79
# File 'lib/ffi-tk/core_extensions.rb', line 77

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