/usr/lib/ruby/vendor_ruby/sequel/extensions/blank.rb is in ruby-sequel 3.33.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | # The blank extension adds the blank? method to all objects (e.g. Object#blank?).
class FalseClass
# false is always blank
def blank?
true
end
end
class Object
# Objects are blank if they respond true to empty?
def blank?
respond_to?(:empty?) && empty?
end
end
class NilClass
# nil is always blank
def blank?
true
end
end
class Numeric
# Numerics are never blank (not even 0)
def blank?
false
end
end
class String
# Strings are blank if they are empty or include only whitespace
def blank?
strip.empty?
end
end
class TrueClass
# true is never blank
def blank?
false
end
end
|