Sha256: 7d44fa2e19c2e7727df5e422358d94b3abb49886272cab9c5ef5c4677dda9264
Contents?: true
Size: 300 Bytes
Versions: 13
Compression:
Stored size: 300 Bytes
Contents
# frozen_string_literal: true require 'active_support/core_ext/object/blank' class Object # @return +block.call(self)+ if +self+ is present, +default_value+ otherwise. def if_present(default_value = nil) return default_value unless present? block_given? ? yield(self) : self end end
Version data entries
13 entries across 13 versions & 2 rubygems