Sha256: 7c2824222e5f81853371e12fe2be107b0f0fff96705c604b1b2dd354b359dba3

Contents?: true

Size: 365 Bytes

Versions: 23

Compression:

Stored size: 365 Bytes

Contents

# frozen_string_literal: true

require "pathname"

class Pathname
  # An Pathname is blank if it's empty:
  #
  #   Pathname.new("").blank?      # => true
  #   Pathname.new(" ").blank?     # => false
  #   Pathname.new("test").blank?  # => false
  #
  # @return [true, false]
  def blank?
    to_s.empty?
  end

  def present? # :nodoc:
    !to_s.empty?
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
activesupport-8.0.1 lib/active_support/core_ext/pathname/blank.rb
activesupport-8.0.0.1 lib/active_support/core_ext/pathname/blank.rb
activesupport-7.2.2.1 lib/active_support/core_ext/pathname/blank.rb
activesupport-8.0.0 lib/active_support/core_ext/pathname/blank.rb
activesupport-7.2.2 lib/active_support/core_ext/pathname/blank.rb
activesupport-8.0.0.rc2 lib/active_support/core_ext/pathname/blank.rb
activesupport-7.2.1.2 lib/active_support/core_ext/pathname/blank.rb
activesupport-8.0.0.rc1 lib/active_support/core_ext/pathname/blank.rb
activesupport-7.2.1.1 lib/active_support/core_ext/pathname/blank.rb
activesupport-8.0.0.beta1 lib/active_support/core_ext/pathname/blank.rb
omg-activesupport-8.0.0.alpha9 lib/active_support/core_ext/pathname/blank.rb
omg-activesupport-8.0.0.alpha8 lib/active_support/core_ext/pathname/blank.rb
omg-activesupport-8.0.0.alpha7 lib/active_support/core_ext/pathname/blank.rb
omg-activesupport-8.0.0.alpha4 lib/active_support/core_ext/pathname/blank.rb
omg-activesupport-8.0.0.alpha3 lib/active_support/core_ext/pathname/blank.rb
omg-activesupport-8.0.0.alpha2 lib/active_support/core_ext/pathname/blank.rb
omg-activesupport-8.0.0.alpha1 lib/active_support/core_ext/pathname/blank.rb
activesupport-7.2.1 lib/active_support/core_ext/pathname/blank.rb
activesupport-7.2.0 lib/active_support/core_ext/pathname/blank.rb
activesupport-7.2.0.rc1 lib/active_support/core_ext/pathname/blank.rb