Class: SC.StatePathMatcher


Extends SC.Object.

The SC.StatePathMatcher is used to match a given state path match expression against state paths. A state path is a basic dot-notion consisting of one or more state names joined using '.'. Ex: 'foo', 'foo.bar'.

The state path match expression language provides a way of expressing a state path. The expression is matched against a state path from the end of the state path to the beginning of the state path. A match is true if the expression has been satisfied by the given path.

Syntax:

expression -> |

path ->

subpath -> '.' | empty

this -> 'this'

part -> |

expansion -> '~'

name -> [a-z_][\w]*

Expression examples:

foo

foo.bar

foo.bar.mah

foo~mah

this.foo

this.foo.bar

this.foo~mah

foo.bar~mah

foo~bar.mah

Defined in: state_path_matcher.js

Field Summary

Instance Methods

Field Detail

expression

The expression used by this matcher to match against given state paths

state

The state that is used to represent 'this' for the matcher's given expression.

See:
#expression
tokens
A parsed set of tokens from the matcher's given expression
See:
#expression

Instance Method Detail

init()
lastPart()

Returns the last part of the expression. So if the expression is 'foo.bar' or 'foo~bar' then 'bar' is returned in both cases. If the expression is 'this' then 'this is returned.

match(path)

Will make a state path against this matcher's expression.

The path provided must follow a basic dot-notation path containing one or dots '.'. Ex: 'foo', 'foo.bar'

Parameters:
path
{String} a dot-notation path
Returns:
Boolean
true if there is a match, otherwise false
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 08 2015 10:02:21 GMT-0600 (CST)