fractaledmind / activeset

A toolkit for working with enumerable sets.
MIT License
2 stars 1 forks source link

Add symbolic aliases for operators #27

Closed fractaledmind closed 5 years ago

fractaledmind commented 5 years ago

The ARel operator methods are all string-y method names, some of which are quite long (e.g. does_not_match_any). Add symbolic aliases for each of the operator methods:

method symbol
eq ==
eq_any E==
eq_all A==
not_eq !=
not_eq_any E!=
not_eq_all A!=
matches =~
matches_any E=~
matches_all A=~
does_not_match !~
does_not_match_any E!~
does_not_match_all A!~
in <<
in_any E<<
in_all A<<
not_in !<
not_in_any E!<
not_in_all A!<
between ..
not_between !.
lt <
lt_any E<
lt_all A<
lteq <=
lteq_any E<=
lteq_all A<=
gt >
gt_any E>
gt_all A>
gteq >=
gteq_any E>=
gteq_all A>=
is_null -
not_null !-
is_present +
not_present !+
start ^
start_any E^
start_all A^
not_start !^
not_start_any E!^
not_start_all A!^
end $
end_any E$
end_all A$
not_end !$
not_end_any E!$
not_end_all A!$
contain *
contain_any E*
contain_all A*
not_contain !*
not_contain_any E!*
not_contain_all A!*

See this list of logical symbols for the background behind the use of E and A here.

fractaledmind commented 5 years ago

Resolved in new monorepo by https://github.com/fractaledmind/actionset/pull/23