Module: Trith::Core::Boolean::Predicates
- Defined in:
- lib/trith/core/boolean.rb
Overview
Boolean predicates.
Instance Method Summary (collapse)
- - (Object) andp(a, b) (also: #and?)
- - (Boolean) boolp(obj) (also: #bool?)
- - (Boolean) falsep(obj) (also: #false?)
- - (Boolean) nilp(obj) (also: #nil?)
- - (Object) notp(a) (also: #not?)
- - (Object) orp(a, b) (also: #or?)
- - (Boolean) truep(obj) (also: #true?)
- - (Object) xorp(a, b) (also: #xor?)
Instance Method Details
- (Object) andp(a, b) Also known as: and?
58 59 60 |
# File 'lib/trith/core/boolean.rb', line 58 def andp(a, b) a && b end |
- (Boolean) boolp(obj) Also known as: bool?
25 26 27 |
# File 'lib/trith/core/boolean.rb', line 25 def boolp(obj) obj.equal?(false) || obj.equal?(true) end |
- (Boolean) falsep(obj) Also known as: false?
33 34 35 |
# File 'lib/trith/core/boolean.rb', line 33 def falsep(obj) obj.equal?(false) end |
- (Boolean) nilp(obj) Also known as: nil?
17 18 19 |
# File 'lib/trith/core/boolean.rb', line 17 def nilp(obj) obj.nil? end |
- (Object) notp(a) Also known as: not?
49 50 51 |
# File 'lib/trith/core/boolean.rb', line 49 def notp(a) !a end |
- (Object) orp(a, b) Also known as: or?
67 68 69 |
# File 'lib/trith/core/boolean.rb', line 67 def orp(a, b) a || b end |
- (Boolean) truep(obj) Also known as: true?
41 42 43 |
# File 'lib/trith/core/boolean.rb', line 41 def truep(obj) obj.equal?(true) end |
- (Object) xorp(a, b) Also known as: xor?
76 77 78 |
# File 'lib/trith/core/boolean.rb', line 76 def xorp(a, b) a ^ b end |