Sha256: 5d6147f84205e7cfbc78dd721d697cdc9dbbde82926bb90b7c0cff4e68c9122b

Contents?: true

Size: 645 Bytes

Versions: 28

Compression:

Stored size: 645 Bytes

Contents

# frozen_string_literal: true
# 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

28 entries across 28 versions & 2 rubygems

Version Path
asciidoctor-2.0.22 lib/asciidoctor/core_ext/nil_or_empty.rb
asciidoctor-2.0.21 lib/asciidoctor/core_ext/nil_or_empty.rb
asciidoctor-2.0.20 lib/asciidoctor/core_ext/nil_or_empty.rb
asciidoctor-2.0.19 lib/asciidoctor/core_ext/nil_or_empty.rb
asciidoctor-2.0.18 lib/asciidoctor/core_ext/nil_or_empty.rb
asciidoctor-2.0.17 lib/asciidoctor/core_ext/nil_or_empty.rb
asciidoctor-2.0.16 lib/asciidoctor/core_ext/nil_or_empty.rb
asciidoctor-2.0.15 lib/asciidoctor/core_ext/nil_or_empty.rb
asciidoctor-2.0.14 lib/asciidoctor/core_ext/nil_or_empty.rb
asciidoctor-2.0.13 lib/asciidoctor/core_ext/nil_or_empty.rb
asciidoctor-2.0.12 lib/asciidoctor/core_ext/nil_or_empty.rb
asciidoctor-2.0.11 lib/asciidoctor/core_ext/nil_or_empty.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/asciidoctor-2.0.10/lib/asciidoctor/core_ext/nil_or_empty.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/asciidoctor-2.0.10/lib/asciidoctor/core_ext/nil_or_empty.rb
asciidoctor-2.0.10 lib/asciidoctor/core_ext/nil_or_empty.rb
asciidoctor-2.0.9 lib/asciidoctor/core_ext/nil_or_empty.rb
asciidoctor-2.0.8 lib/asciidoctor/core_ext/nil_or_empty.rb
asciidoctor-2.0.7 lib/asciidoctor/core_ext/nil_or_empty.rb
asciidoctor-2.0.6 lib/asciidoctor/core_ext/nil_or_empty.rb
asciidoctor-2.0.5 lib/asciidoctor/core_ext/nil_or_empty.rb