Bottle.Binary (Bottle v1.0.1) 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

Link to this macro

is_binary_shorter_than(sub, max_length)

View Source (macro)

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
Link to this macro

is_empty_binary(sub)

View Source (macro)

Guard that passes for an empty binary

Examples

iex> is_empty_binary("")
true

iex> is_empty_binary("foo")
false
Link to this macro

is_non_empty_binary(sub)

View Source (macro)

Guard that passes for a non-empty binary

Examples

iex> is_non_empty_binary("false")
true

iex> is_non_empty_binary("")
false
Link to this macro

is_non_empty_binary_shorter_than(sub, max_length)

View Source (macro)

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