Sha256: d31343d0b4a0de2f7348a8558620fc78b38c20e9a1184b337adfefa4ddbae4b4

Contents?: true

Size: 618 Bytes

Versions: 35

Compression:

Stored size: 618 Bytes

Contents

# blank? parts taken from the active support source
# code, used under the MIT License.

class Object
  def blank?
    respond_to?(:empty?) ? empty? : !self
  end

  def present?
    !blank?
  end

end
 
class NilClass #:nodoc:
  def blank?
    true
  end
end
 
class FalseClass #:nodoc:
  def blank?
    true
  end
end
 
class TrueClass #:nodoc:
  def blank?
    false
  end
end
 
class Array #:nodoc:
  alias_method :blank?, :empty?
end
 
class Hash #:nodoc:
  alias_method :blank?, :empty?
end
 
class String #:nodoc:
  def blank?
    self !~ /\S/
  end
end
 
class Numeric #:nodoc:
  def blank?
    false
  end
end

Version data entries

35 entries across 35 versions & 2 rubygems

Version Path
Sutto-perennial-0.1.0 lib/perennial/core_ext/blank.rb
Sutto-perennial-0.2.0 lib/perennial/core_ext/blank.rb
Sutto-perennial-0.2.1 lib/perennial/core_ext/blank.rb
Sutto-perennial-0.2.2.1 lib/perennial/core_ext/blank.rb
Sutto-perennial-0.2.2.2 lib/perennial/core_ext/blank.rb
Sutto-perennial-0.2.2.3 lib/perennial/core_ext/blank.rb
Sutto-perennial-0.2.2 lib/perennial/core_ext/blank.rb
Sutto-perennial-0.2.3.0 lib/perennial/core_ext/blank.rb
Sutto-perennial-0.2.3.1 lib/perennial/core_ext/blank.rb
Sutto-perennial-0.2.3.2 lib/perennial/core_ext/blank.rb
Sutto-perennial-0.2.3.3 lib/perennial/core_ext/blank.rb
Sutto-perennial-0.2.3.4 lib/perennial/core_ext/blank.rb
Sutto-perennial-0.2.3.5 lib/perennial/core_ext/blank.rb
Sutto-perennial-0.2.3.6 lib/perennial/core_ext/blank.rb
Sutto-perennial-0.2.3.7 lib/perennial/core_ext/blank.rb
Sutto-perennial-0.2.4.0 lib/perennial/core_ext/blank.rb
Sutto-perennial-0.2.4.1 lib/perennial/core_ext/blank.rb
Sutto-perennial-0.2.4.5 lib/perennial/core_ext/blank.rb
Sutto-perennial-0.2.4.6 lib/perennial/core_ext/blank.rb
Sutto-perennial-1.0.0.0 lib/perennial/core_ext/blank.rb