Class: NilClass
Overview
NilClass
is extended with a few methods
Instance Method Summary collapse
-
#and(other) ⇒ FalseClass
Boolean ‘and’ operation.
-
#compilable? ⇒ FalseClass, TrueClass
Check whether this term is compilable.
-
#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
244 245 246 247 248 249 250 251 |
# File 'lib/multiarray.rb', line 244 def and( other ) unless other.matched? self else x, y = other.coerce self x.and y end end |
#compilable? ⇒ FalseClass, TrueClass
Check whether this term is compilable
304 305 306 |
# File 'lib/multiarray.rb', line 304 def compilable? false end |
#conditional(a, b) ⇒ Object
Boolean select operation
277 278 279 |
# File 'lib/multiarray.rb', line 277 def conditional( a, b ) b.is_a?( Proc ) ? b.call : b end |
#if(&action) ⇒ Object
Conditional operation
286 287 |
# File 'lib/multiarray.rb', line 286 def if( &action ) end |
#if_else(action1, action2) ⇒ Object
Conditional operation
295 296 297 |
# File 'lib/multiarray.rb', line 295 def if_else( action1, action2 ) action2.call end |
#not ⇒ FalseClass
Boolean negation
233 234 235 |
# File 'lib/multiarray.rb', line 233 def not true end |
#or(other) ⇒ FalseClass, TrueClass
Boolean ‘or’ operation
260 261 262 263 264 265 266 267 |
# File 'lib/multiarray.rb', line 260 def or( other ) unless other.matched? other else x, y = other.coerce self x.or y end end |