Sha256: 80146e51e88eb94debbf0b37c689387f247a0df56211dc798a4648528a5c96e7

Contents?: true

Size: 625 Bytes

Versions: 1

Compression:

Stored size: 625 Bytes

Contents

# A core library extension that defines the method nil_or_empty? as an alias to
# optimize checks for nil? or empty? on common object types such as NilClass,
# String, Array, Hash, and Numeric.

class NilClass
  alias :nil_or_empty? :nil? unless method_defined? :nil_or_empty?
end

class String
  alias :nil_or_empty? :empty? unless method_defined? :nil_or_empty?
end

class Array
  alias :nil_or_empty? :empty? unless method_defined? :nil_or_empty?
end

class Hash
  alias :nil_or_empty? :empty? unless method_defined? :nil_or_empty?
end

class Numeric
  alias :nil_or_empty? :nil? unless method_defined? :nil_or_empty?
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
asciidoctor-1.5.5 lib/asciidoctor/core_ext/nil_or_empty.rb