lib/open_classes/object.rb in tbpgr_utils-0.0.2 vs lib/open_classes/object.rb in tbpgr_utils-0.0.3
- old
+ new
@@ -1,14 +1,20 @@
# encoding: utf-8
-# =Object
+#= Object
class Object
- # == check boolean type
+ #== check boolean type
def boolean?
self.is_a?(TrueClass) || self.is_a?(FalseClass)
end
- # ==get self define methods.
+ #== get self define methods.
def my_methods
public_methods(false) + protected_methods(false) + private_methods(false)
+ end
+
+ #== if self match any one of args, return true.
+ def any_of?(*args)
+ args.each {|value|return true if self == value}
+ false
end
end