Sha256: 6663950fa22c41daa5a1386f19af998f37db77925e544c906bef2ebce481960e

Contents?: true

Size: 509 Bytes

Versions: 1

Compression:

Stored size: 509 Bytes

Contents

# util.rb is inspired by ActiveSupport

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

class NilClass
  def blank?
    true
  end
end

class FalseClass
  def blank?
    true
  end
end

class TrueClass
  def blank?
    false
  end
end

class Array
  alias_method :blank?, :empty?
end

class Hash
  alias_method :blank?, :empty?
end

class String
  def blank?
    self !~ /[^[:space:]]/
  end
end

class Numeric #:nodoc:
  def blank?
    false
  end
end

module Rmake::Util
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rmake-notation-0.0.1 lib/rmake-util.rb