Class: NilClass
Overview
NilClass
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
236 237 238 239 240 241 242 243 |
# File 'docs/multiarray/lib/multiarray.rb', line 236 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
269 270 271 |
# File 'docs/multiarray/lib/multiarray.rb', line 269 def conditional( a, b ) b.is_a?( Proc ) ? b.call : b end |
#if(&action) ⇒ Object
Conditional operation
278 279 |
# File 'docs/multiarray/lib/multiarray.rb', line 278 def if( &action ) end |
#if_else(action1, action2) ⇒ Object
Conditional operation
287 288 289 |
# File 'docs/multiarray/lib/multiarray.rb', line 287 def if_else( action1, action2 ) action2.call end |
#not ⇒ FalseClass
Boolean negation
225 226 227 |
# File 'docs/multiarray/lib/multiarray.rb', line 225 def not true end |
#or(other) ⇒ FalseClass, TrueClass
Boolean ‘or’ operation
252 253 254 255 256 257 258 259 |
# File 'docs/multiarray/lib/multiarray.rb', line 252 def or( other ) unless other.matched? other else x, y = other.coerce self x.or y end end |