Module: Babl::Operators::Nullable::DSL

Included in:
Template
Defined in:
lib/babl/operators/nullable.rb

Instance Method Summary collapse

Instance Method Details

#nullable(nullcond = unscoped.null?) ⇒ Object

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



10
11
12
13
14
15
16
17
# File 'lib/babl/operators/nullable.rb', line 10

def nullable(nullcond = unscoped.null?)
    source {
        switch(
            nullcond => nil,
            default => continue
        )
    }
end