Method: Censive#quote_type

Defined in:
lib/censive.rb

#quote_type(str) ⇒ Object

returns 2 (must be quoted and escaped), 1 (must be quoted), 0 (neither)



254
255
256
257
258
259
260
# File 'lib/censive.rb', line 254

def quote_type(str)
  if idx = str&.index(@escapes)
    $1 ? 2 : str.index(@quote, idx) ? 2 : 1
  else
    0
  end
end