View Source PropertyTable.Matcher.StringPath (property_table v0.2.5)

Match logic using keys organized as hierarchical lists

Property keys that are lists look like ["first", "second", "third"]. These are intended to create a hierarchical organization of keys. Matching patterns involves checking whether the pattern is at the beginning of the key. This makes it possible to get notified on every property change where the key begins with ["first", "second"]. This is a really common use case when using hierarchically organized keys.

Two special atoms can be used:

  • :_ - match anything at this part of the list
  • :$ - match the end of the list

Summary

Functions

Check whether a pattern is valid

Check whether a property is valid

Returns true if the pattern matches the specified property

Functions

Check whether a pattern is valid

Returns :ok on success or {:error, error} where error is an Exception struct with information about the issue.

Check whether a property is valid

Returns :ok on success or {:error, error} where error is an Exception struct with information about the issue.

Returns true if the pattern matches the specified property