Class: String

Inherits:
Object show all
Defined in:
lib/sailpoint/core_ext/blank.rb,
lib/sailpoint/core_ext/escape_str.rb

Overview

Used to override and give String the blank? validation similar to Rails

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Used to determine if the object is nil or empty (”)

Returns:

  • (Boolean)


18
19
20
# File 'lib/sailpoint/core_ext/blank.rb', line 18

def blank?
  strip&.empty? || strip&.length&.zero?
end

#escape_strString

Escape any special characters to make them URL safe

Returns:



16
17
18
# File 'lib/sailpoint/core_ext/escape_str.rb', line 16

def escape_str
  CGI.escape(strip)
end