Module: Kernel
- Defined in:
- lib/assay/core_ext/kernel.rb
Instance Method Summary collapse
- #boolean? ⇒ Boolean
- #false? ⇒ Boolean
-
#identical?(other) ⇒ Boolean
Do two references have the same ‘#object_id`, and hence are the same object.
-
#like?(other) ⇒ Boolean
Ascertain likeness, returns true if any of ‘equal?`, `eql?`, `==`, `===` or `=~` evaluate truthfully, either with `self` as the receiver or `other` as the receiver.
- #true? ⇒ Boolean
Instance Method Details
#boolean? ⇒ Boolean
48 49 50 |
# File 'lib/assay/core_ext/kernel.rb', line 48 def boolean? true? || false? end |
#false? ⇒ Boolean
43 44 45 |
# File 'lib/assay/core_ext/kernel.rb', line 43 def false? FalseClass === self end |
#identical?(other) ⇒ Boolean
Do two references have the same ‘#object_id`, and hence are the same object.
9 10 11 |
# File 'lib/assay/core_ext/kernel.rb', line 9 def identical?(other) object_id == other.object_id end |
#like?(other) ⇒ Boolean
TODO:
Should ‘#=~` be apart of this comparison?
Ascertain likeness, returns true if any of ‘equal?`, `eql?`, `==`, `===` or `=~` evaluate truthfully, either with `self` as the receiver or `other` as the receiver.
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/assay/core_ext/kernel.rb', line 24 def like?(other) self.equal?(other) || self.eql?(other) || self.==(other) || self.===(other) || self.=~(other) || other.equal?(self) || other.eql?(self) || other.==(self) || other.===(self) || other.=~(self) end |
#true? ⇒ Boolean
38 39 40 |
# File 'lib/assay/core_ext/kernel.rb', line 38 def true? TrueClass === self end |