Sha256: 561e542544efbae97344760d08f89332c493d1fbb650e10c920921b134260216
Contents?: true
Size: 1.21 KB
Versions: 14
Compression:
Stored size: 1.21 KB
Contents
# frozen_string_literal: true module Doing # Object helpers class ::Object ## ## Tests if object is nil or empty ## ## @return [Boolean] true if object is defined and ## has content ## def good? !nil? && !empty? end end class ::String ## ## Tests if object is nil or empty ## ## @return [Boolean] true if object is defined and ## has content ## def good? !strip.empty? end end class ::Array ## ## Tests if object is nil or empty ## ## @return [Boolean] true if object is defined and ## has content ## def good? !nil? && !empty? end end class ::FalseClass ## ## Tests if object is nil or empty ## ## @return [Boolean] true if object is defined and ## has content ## def good? false end def normalize_tag_sort :time end end class ::TrueClass ## ## Tests if object is nil or empty ## ## @return [Boolean] true if object is defined and ## has content ## def good? true end def normalize_tag_sort :name end end end
Version data entries
14 entries across 14 versions & 1 rubygems