Class: Object

Inherits:
BasicObject
Defined in:
lib/lib/object.rb

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Self empty? class.

Returns:

  • (Boolean)

    boolean



40
41
42
# File 'lib/lib/object.rb', line 40

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

#boolean?Boolean

Self test Boolean class.

Returns:

  • (Boolean)

    boolean



5
6
7
# File 'lib/lib/object.rb', line 5

def boolean?
  is_a?(TrueClass) || is_a?(FalseClass)
end

#false?Boolean

Self test Falseclass.

Returns:

  • (Boolean)

    boolean



19
20
21
# File 'lib/lib/object.rb', line 19

def false?
  is_a?(FalseClass)
end

#present?Boolean

Self blank class.

Returns:

  • (Boolean)

    boolean



47
48
49
# File 'lib/lib/object.rb', line 47

def present?
  !blank?
end

#string?Boolean

Self test String class.

Returns:

  • (Boolean)

    boolean



33
34
35
# File 'lib/lib/object.rb', line 33

def string?
  is_a?(String)
end

#symbol?Boolean

Self test Symbol class.

Returns:

  • (Boolean)

    boolean



26
27
28
# File 'lib/lib/object.rb', line 26

def symbol?
  is_a?(Symbol)
end

#true?Boolean

Self test Trueclass.

Returns:

  • (Boolean)

    boolean



12
13
14
# File 'lib/lib/object.rb', line 12

def true?
  is_a?(TrueClass)
end