View Source Recode.Utils (Recode v0.5.0)

This module provides utility functions for recode.

Link to this section Summary

Functions

Returns true id value ends with suffix.

Link to this section Functions

Link to this function

ends_with?(value, suffix)

View Source
@spec ends_with?(value :: list() | module(), suffix :: list() | module()) :: boolean()

Returns true id value ends with suffix.

Both, value and suffix must be lists or module aliases.

examples

Examples

iex> Recode.Utils.ends_with?(Foo.Bar, Bar)
true
iex> Recode.Utils.ends_with?(Foo, Foo.Bar)
false
iex> Recode.Utils.ends_with?(Foo.Bar, Baz)
false

iex> Recode.Utils.ends_with?([1, 2, 3], [2, 3])
true
iex> Recode.Utils.ends_with?([1, 2, 3], [2, 9])
false