Files
beef/core/ruby/object.rb
jcrew99 486a9bb329 Update copyright 2023 (#2675)
* updated copyright

* reverted gemfile lock changes
2022-12-31 15:36:07 +10:00

43 lines
1.0 KiB
Ruby

#
# Copyright (c) 2006-2023 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
class Object
# Returns true if the object is a Boolean
# @return [Boolean] Whether the object is boolean
def boolean?
is_a?(TrueClass) || is_a?(FalseClass)
end
# Returns true if the object is a String
# @return [Boolean] Whether the object is a string
def string?
is_a?(String)
end
# Returns true if the object is an Integer
# @return [Boolean] Whether the object is an integer
def integer?
is_a?(Integer)
end
# Returns true if the object is a hash
# @return [Boolean] Whether the object is a hash
def hash?
is_a?(Hash)
end
# Returns true if the object is a class
# @return [Boolean] Whether the object is a class
def class?
is_a?(Class)
end
# Returns true if the object is nil, and empty string, or empty array
# @return [Boolean]
def blank?
respond_to?(:empty?) ? !!empty? : !self
end
end