Module: OmniauthOpenidFederation::StringHelpers
- Defined in:
- lib/omniauth_openid_federation/string_helpers.rb
Class Method Summary collapse
-
.blank?(value) ⇒ Boolean
Check if a value is blank (nil, empty string, or whitespace-only string).
-
.present?(value) ⇒ Boolean
Check if a value is present (not nil, not empty string, not blank).
Class Method Details
.blank?(value) ⇒ Boolean
Check if a value is blank (nil, empty string, or whitespace-only string)
26 27 28 |
# File 'lib/omniauth_openid_federation/string_helpers.rb', line 26 def self.blank?(value) !present?(value) end |
.present?(value) ⇒ Boolean
Check if a value is present (not nil, not empty string, not blank)
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/omniauth_openid_federation/string_helpers.rb', line 9 def self.present?(value) case value when String !value.empty? && !value.strip.empty? when NilClass false when Array, Hash !value.empty? else !value.nil? end end |