View Source Ash.CiString (ash v3.4.43)
Represents a case insensitive string
While some data layers are aware of case insensitive string types, in order for values
of this type to be used in other parts of Ash Framework, it has to be embedded in a module
this allows us to implement the Comparable
protocol for it.
For the type implementation, see Ash.Type.CiString
Summary
Functions
Compares an Elixir String or Ash.CiString. It will return :eq
if equal, :lt
, if
the string is ordered alphabetically before the second string, and :gt
if after.
Returns a Ash.CiString from a String, or nil
if the value is nil
.
Creates a case insensitive string
Returns the downcased value, only downcasing if it hasn't already been done
Converts a Ash.CiString
into a normal Elixir String.
Types
Functions
@spec compare(string_type(), string_type()) :: :gt | :lt | :eq
Compares an Elixir String or Ash.CiString. It will return :eq
if equal, :lt
, if
the string is ordered alphabetically before the second string, and :gt
if after.
@spec new(string_type() | nil, casing()) :: t() | nil
Returns a Ash.CiString from a String, or nil
if the value is nil
.
@spec sigil_i( string_type() | nil, charlist() ) :: t()
Creates a case insensitive string
@spec to_comparable_string(string_type() | nil) :: String.t() | nil
Returns the downcased value, only downcasing if it hasn't already been done
Converts a Ash.CiString
into a normal Elixir String.