Bottle.Binary (Bottle v0.1.2) View Source
Provides custom guards for binaries
Link to this section Summary
Functions
Guard that passes for a binary shorter than max_length
Guard that passes for an empty binary
Guard that passes for a non-empty binary
Guard that passes for a non-empty-binary shorter than max_length
Link to this section Functions
Guard that passes for a binary shorter than max_length
Examples
iex> is_binary_shorter_than("foo", 200) true
iex> is_binary_shorter_than("", 2) true
iex> is_binary_shorter_than("foo", 2) false
iex> is_binary_shorter_than({"anything", "else"}, 2) false
Guard that passes for an empty binary
Examples
iex> is_empty_binary("") true
iex> is_empty_binary("foo") false
iex> is_empty_binary({"anything", "else"}) false
Guard that passes for a non-empty binary
Examples
iex> is_non_empty_binary("false") true
iex> is_non_empty_binary("") false
iex> is_non_empty_binary({"anything", "else"}) false
Guard that passes for a non-empty-binary shorter than max_length
Examples
iex> is_non_empty_binary_shorter_than("foo", 200) true
iex> is_non_empty_binary_shorter_than("", 2) false
iex> is_non_empty_binary_shorter_than("foo", 2) false
iex> is_non_empty_binary_shorter_than({"anything", "else"}, 2) false