Boolean Conditions - GenesisCoast/conditions-py GitHub Wiki

Introduction

Conditions

is_true()

Checks whether the given value is True. An ArgumentError is thrown otherwise.

value = False

Condition\
    .requires_bool(value, "value")\
    .is_true() # Throws an `ArgumentError`

Condition\
    .ensures_bool(value, "value")\
    .is_true() # Throws an `ArgumentError`

is_false()

Checks whether the given value is False. An ArgumentError is thrown otherwise.

value = True

Condition\
    .requires_bool(value, "value")\
    .is_false() # Throws an `ArgumentError`

Condition\
    .ensures_bool(value, "value")\
    .is_false() # Throws an `ArgumentError`