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
332 333 334 335 336 337 338 339 |
# File 'lib/multiarray.rb', line 332 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
365 366 367 |
# File 'lib/multiarray.rb', line 365 def conditional( a, b ) b.is_a?( Proc ) ? b.call : b end |
#if(&action) ⇒ Object
Conditional operation
374 375 |
# File 'lib/multiarray.rb', line 374 def if( &action ) end |
#if_else(action1, action2) ⇒ Object
Conditional operation
383 384 385 |
# File 'lib/multiarray.rb', line 383 def if_else( action1, action2 ) action2.call end |
#not ⇒ FalseClass
Boolean negation
321 322 323 |
# File 'lib/multiarray.rb', line 321 def not true end |
#or(other) ⇒ FalseClass, TrueClass
Boolean ‘or’ operation
348 349 350 351 352 353 354 355 |
# File 'lib/multiarray.rb', line 348 def or( other ) unless other.matched? other else x, y = other.coerce self x.or y end end |