Sha256: c60986685609fbdf0d6991a92831eb3996f2213b4eaedaaf5f5d24d16536e4eb

Contents?: true

Size: 702 Bytes

Versions: 7

Compression:

Stored size: 702 Bytes

Contents

class Object
  # Self test Boolean class.
  #
  # @return   boolean
  def boolean?
    is_a?(TrueClass) || is_a?(FalseClass)
  end

  # Self test Trueclass.
  #
  # @return   boolean
  def true?
    is_a?(TrueClass)
  end

  # Self test Falseclass.
  #
  # @return   boolean
  def false?
    is_a?(FalseClass)
  end

  # Self test Symbol class.
  #
  # @return   boolean
  def symbol?
    is_a?(Symbol)
  end

  # Self test String class.
  #
  # @return   boolean
  def string?
    is_a?(String)
  end

  # Self empty? class.
  #
  # @return   boolean
  def blank?
    respond_to?(:empty?) ? !!empty? : !self
  end

  # Self blank class.
  #
  # @return   boolean
  def present?
    !blank?
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tools-1.2.0 lib/lib/object.rb
tools-1.1.0 lib/lib/object.rb
tools-1.0.1 lib/lib/object.rb
tools-1.0.0 lib/lib/object.rb
tools-0.5.4 lib/lib/object.rb
tools-0.5.3 lib/lib/object.rb
tools-0.5.1 lib/lib/object.rb