Solid.Expression (solid v0.15.2) View Source
Expression evaluation for the following binary operators:
== != > < >= <=
Also combine expressions with and
, or
Link to this section Summary
Functions
Evaluate a single expression iex> Solid.Expression.eval({"Beer Pack", :contains, "Pack"}) true iex> Solid.Expression.eval({1, :==, 2}) false iex> Solid.Expression.eval({1, :==, 1}) true iex> Solid.Expression.eval({1, :!=, 2}) true iex> Solid.Expression.eval({1, :!=, 1}) false iex> Solid.Expression.eval({1, :<, 2}) true iex> Solid.Expression.eval({1, :<, 1}) false iex> Solid.Expression.eval({1, :>, 2}) false iex> Solid.Expression.eval({2, :>, 1}) true iex> Solid.Expression.eval({1, :>=, 1}) true iex> Solid.Expression.eval({1, :>=, 0}) true iex> Solid.Expression.eval({1, :>=, 2}) false iex> Solid.Expression.eval({1, :<=, 1}) true iex> Solid.Expression.eval({1, :<=, 0}) false iex> Solid.Expression.eval({1, :<=, 2}) true iex> Solid.Expression.eval({"Meat", :contains, "Pack"}) false iex> Solid.Expression.eval({["Beer", "Pack"], :contains, "Pack"}) true iex> Solid.Expression.eval({["Meat"], :contains, "Pack"}) false iex> Solid.Expression.eval({nil, :contains, "Pack"}) false iex> Solid.Expression.eval({"Meat", :contains, nil}) false iex> Solid.Expression.eval(true) true iex> Solid.Expression.eval(false) false iex> Solid.Expression.eval(nil) false iex> Solid.Expression.eval(1) true iex> Solid.Expression.eval("") true iex> Solid.Expression.eval({0, :<=, nil}) false iex> Solid.Expression.eval({1.0, :<, nil}) false iex> Solid.Expression.eval({nil, :>=, 1.0}) false iex> Solid.Expression.eval({nil, :>, 0}) false
Evaluate a list of expressions combined with or
, and
Link to this section Types
Specs
Link to this section Functions
Specs
Evaluate a single expression iex> Solid.Expression.eval({"Beer Pack", :contains, "Pack"}) true iex> Solid.Expression.eval({1, :==, 2}) false iex> Solid.Expression.eval({1, :==, 1}) true iex> Solid.Expression.eval({1, :!=, 2}) true iex> Solid.Expression.eval({1, :!=, 1}) false iex> Solid.Expression.eval({1, :<, 2}) true iex> Solid.Expression.eval({1, :<, 1}) false iex> Solid.Expression.eval({1, :>, 2}) false iex> Solid.Expression.eval({2, :>, 1}) true iex> Solid.Expression.eval({1, :>=, 1}) true iex> Solid.Expression.eval({1, :>=, 0}) true iex> Solid.Expression.eval({1, :>=, 2}) false iex> Solid.Expression.eval({1, :<=, 1}) true iex> Solid.Expression.eval({1, :<=, 0}) false iex> Solid.Expression.eval({1, :<=, 2}) true iex> Solid.Expression.eval({"Meat", :contains, "Pack"}) false iex> Solid.Expression.eval({["Beer", "Pack"], :contains, "Pack"}) true iex> Solid.Expression.eval({["Meat"], :contains, "Pack"}) false iex> Solid.Expression.eval({nil, :contains, "Pack"}) false iex> Solid.Expression.eval({"Meat", :contains, nil}) false iex> Solid.Expression.eval(true) true iex> Solid.Expression.eval(false) false iex> Solid.Expression.eval(nil) false iex> Solid.Expression.eval(1) true iex> Solid.Expression.eval("") true iex> Solid.Expression.eval({0, :<=, nil}) false iex> Solid.Expression.eval({1.0, :<, nil}) false iex> Solid.Expression.eval({nil, :>=, 1.0}) false iex> Solid.Expression.eval({nil, :>, 0}) false
Specs
eval(list(), Solid.Context.t(), Keyword.t()) :: {boolean(), Solid.Context.t()}
Evaluate a list of expressions combined with or
, and