Provided by: libcatmandu-perl_1.2020-1_all
NAME
Catmandu::Fix::Condition - Role for all Catmandu::Fix conditionals
SYNOPSIS
if <Catmandu::Fix::Condition instance> <pass_fixes> else <fail_fixes> end
DESCRIPTION
All Catmandu::Fix conditions need to implement Catmandu::Fix::Condition. This subclass of Catmandu::Fix::Base provides a list of fixes that need to be executed when a conditional matches (pass_fixes) and conditional that need to be executed when a conditional fails (fail_fixes). Conditions can be used as inline fixes as well: use Catmandu::Fix::Condition::exists as => 'has_field'; my $item = { foo => { bar => 1 } }; has_field($item, 'foo.bar'); # true has_field($item, 'doz'); # false
EXAMPLES
Catmandu core comes with the following conditions: • all_equal • all_match • any_equal • any_match • exists • greater_than • in • is_array • is_false • is_null • is_number • is_object • is_string • is_true • less_than