Class: NilClass
Overview
NilClass is extended with a few methods
Instance Method Summary (collapse)
-
- (FalseClass) and(other)
Boolean 'and' operation.
-
- (Object) conditional(a, b)
Boolean select operation.
-
- (Object) if(&action)
Conditional operation.
-
- (Object) if_else(action1, action2)
Conditional operation.
-
- (FalseClass) not
Boolean negation.
-
- (FalseClass, TrueClass) or(other)
Boolean 'or' operation.
Instance Method Details
- (FalseClass) and(other)
Boolean 'and' operation
236 237 238 239 240 241 242 243 |
# File 'lib/multiarray.rb', line 236 def and( other ) unless other.matched? self else x, y = other.coerce self x.and y end end |
- (Object) conditional(a, b)
Boolean select operation
269 270 271 |
# File 'lib/multiarray.rb', line 269 def conditional( a, b ) b.is_a?( Proc ) ? b.call : b end |
- (Object) if(&action)
Conditional operation
278 279 |
# File 'lib/multiarray.rb', line 278 def if( &action ) end |
- (Object) if_else(action1, action2)
Conditional operation
287 288 289 |
# File 'lib/multiarray.rb', line 287 def if_else( action1, action2 ) action2.call end |
- (FalseClass) not
Boolean negation
225 226 227 |
# File 'lib/multiarray.rb', line 225 def not true end |
- (FalseClass, TrueClass) or(other)
Boolean 'or' operation
252 253 254 255 256 257 258 259 |
# File 'lib/multiarray.rb', line 252 def or( other ) unless other.matched? other else x, y = other.coerce self x.or y end end |