class Polars::ChainedThen

@private

def self._from_rbexpr(rbexpr)

def self._from_rbexpr(rbexpr)
  Utils.wrap_expr(rbexpr)
end

def _rbexpr

def _rbexpr
  _chained_then.otherwise(Polars.lit(nil)._rbexpr)
end

def initialize(chained_then)

def initialize(chained_then)
  self._chained_then = chained_then
end

def otherwise(statement)

def otherwise(statement)
  statement_rbexpr = Utils.parse_into_expression(statement)
  Utils.wrap_expr(_chained_then.otherwise(statement_rbexpr))
end

def when(*predicates, **constraints)

def when(*predicates, **constraints)
  condition_rbexpr = Utils.parse_predicates_constraints_into_expression(*predicates, **constraints)
  ChainedWhen.new(_chained_then.when(condition_rbexpr))
end