Method: Screencap::Phantom#quoted_arg

Defined in:
lib/screencap/phantom.rb

#quoted_arg(arg) ⇒ Object



22
23
24
25
26
27
# File 'lib/screencap/phantom.rb', line 22

def quoted_arg(arg)
  return arg if arg.starts_with?("'") && arg.ends_with?("'")
  arg = "'" + arg unless arg.starts_with?("'")
  arg = arg + "'" unless arg.ends_with?("'")
  arg
end