module Babl::Operators::Nullable::DSL

Public Instance Methods

nullable(nullcond = unscoped.null?) click to toggle source

Nullify the current construction if the condition is truthy. By default, it produces null when the current element is Nil.

# File lib/babl/operators/nullable.rb, line 10
def nullable(nullcond = unscoped.null?)
    source {
        switch(
            nullcond => nil,
            default => continue
        )
    }
end