Module: Darthjee::CoreExt::Object
- Included in:
- Object
- Defined in:
- lib/darthjee/core_ext/object.rb
Instance Method Summary collapse
-
#is_any?(*classes) ⇒ ::TrueClass, ::FalseClass
Checks if object is any of the given classes.
-
#trueful? ⇒ ::TrueClass, ::FalseClass
Checks if object is evaluated to true.
Instance Method Details
#is_any?(*classes) ⇒ ::TrueClass, ::FalseClass
Checks if object is any of the given classes
20 21 22 23 24 |
# File 'lib/darthjee/core_ext/object.rb', line 20 def is_any?(*classes) classes.any? do |clazz| is_a?(clazz) end end |
#trueful? ⇒ ::TrueClass, ::FalseClass
Checks if object is evaluated to true
35 36 37 38 39 |
# File 'lib/darthjee/core_ext/object.rb', line 35 def trueful? # rubocop: disable Style/DoubleNegation !!self # rubocop: enable Style/DoubleNegation end |