Sha256: 164b150eb700c52cbc1a62369d8549ad3a06bc476ec3115ed20f022478281b0d

Contents?: true

Size: 307 Bytes

Versions: 4

Compression:

Stored size: 307 Bytes

Contents

module IOStreams
  module Utils
    # Helper method: Returns [true|false] if a value is blank?
    def self.blank?(value)
      if value.nil?
        true
      elsif value.is_a?(String)
        value !~ /\S/
      else
        value.respond_to?(:empty?) ? value.empty? : !value
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
iostreams-0.20.3 lib/io_streams/utils.rb
iostreams-0.20.2 lib/io_streams/utils.rb
iostreams-0.20.1 lib/io_streams/utils.rb
iostreams-0.20.0 lib/io_streams/utils.rb