Class: FalseClass
Overview
FalseClass
is extended with a few methods
Instance Method Summary collapse
-
#and(other) ⇒ FalseClass
Boolean ‘and’ operation.
-
#conditional(a, b) ⇒ Object
Boolean select operation.
-
#if(&action) ⇒ Object
Conditional operation.
-
#if_else(action1, action2) ⇒ Object
Conditional operation.
-
#not ⇒ FalseClass
Boolean negation.
-
#or(other) ⇒ FalseClass, TrueClass
Boolean ‘or’ operation.
Instance Method Details
#and(other) ⇒ FalseClass
Boolean ‘and’ operation
324 325 326 327 328 329 330 331 |
# File 'docs/multiarray/lib/multiarray.rb', line 324 def and( other ) unless other.matched? self else x, y = other.coerce self x.and y end end |
#conditional(a, b) ⇒ Object
Boolean select operation
357 358 359 |
# File 'docs/multiarray/lib/multiarray.rb', line 357 def conditional( a, b ) b.is_a?( Proc ) ? b.call : b end |
#if(&action) ⇒ Object
Conditional operation
366 367 |
# File 'docs/multiarray/lib/multiarray.rb', line 366 def if( &action ) end |
#if_else(action1, action2) ⇒ Object
Conditional operation
375 376 377 |
# File 'docs/multiarray/lib/multiarray.rb', line 375 def if_else( action1, action2 ) action2.call end |
#not ⇒ FalseClass
Boolean negation
313 314 315 |
# File 'docs/multiarray/lib/multiarray.rb', line 313 def not true end |
#or(other) ⇒ FalseClass, TrueClass
Boolean ‘or’ operation
340 341 342 343 344 345 346 347 |
# File 'docs/multiarray/lib/multiarray.rb', line 340 def or( other ) unless other.matched? other else x, y = other.coerce self x.or y end end |