module Revolut::Utils

Custom utilities

Constants

BLANK_RE

Public Class Methods

blank?(obj) click to toggle source
# File lib/revolut/utils.rb, line 9
def blank?(obj)
  return !!BLANK_RE.match(obj) if obj.is_a?(String)

  obj.respond_to?(:empty?) ? !!obj.empty? : !obj
end
presence(obj) click to toggle source
# File lib/revolut/utils.rb, line 19
def presence(obj)
  obj if present?(obj)
end
present?(obj) click to toggle source
# File lib/revolut/utils.rb, line 15
def present?(obj)
  !blank?(obj)
end