Property | Type | Description | |
---|---|---|---|
ValueTypeTransformers | Dictionary |
Method | Description | |
---|---|---|
AddFilters ( ) : void | ||
AddFilters ( IEnumerable |
Adds filters to this context. this does not register the filters with the main Template object. see Template.register_filter for that
|
|
ClearInstanceAssigns ( ) : void | ||
Context ( ) : System | ||
Context ( List |
||
GetValueTypeTransformer ( |
||
HandleError ( |
||
HasKey ( string key ) : bool | ||
Invoke ( string method, List | ||
Merge ( Hash newScopes ) : void |
Merge a hash of variables in the current local scope
|
|
Pop ( ) : Hash |
Pop from the stack. use Context#stack instead
|
|
Push ( Hash newScope ) : void |
Push new local scope on the stack. use Context#stack instead
|
|
Stack ( System.Action callback ) : void | ||
Stack ( Hash newScope, System.Action callback ) : void |
pushes a new local scope on the stack, pops it at the end of the block Example: context.stack do context['var'] = 'hi' end context['var] #=> nil
|
|
this ( string key ) : object |
Only allow String, Numeric, Hash, Array, Proc, Boolean or Liquid::Drop
|
Method | Description | |
---|---|---|
FindVariable ( string key ) : object |
Fetches an object starting at the local scope and then moving up the hierarchy
|
|
IsHashOrArrayLikeObject ( object obj, object part ) : bool | ||
Liquidize ( object obj ) : object | ||
LookupAndEvaluate ( object obj, object key ) : object | ||
Resolve ( string key ) : object |
Look up variable, either resolve directly after considering the name. We can directly handle Strings, digits, floats and booleans (true,false). If no match is made we lookup the variable in the current scope and later move up to the parent blocks to see if we can resolve the variable somewhere up the tree. Some special keywords return symbols. Those symbols are to be called on the rhs object in expressions Example: products == empty #=> products.empty?
|
|
SquashInstanceAssignsWithEnvironments ( ) : void | ||
Variable ( string markup ) : object |
Resolves namespaced queries gracefully. Example @context['hash'] = {"name" => 'tobi'} assert_equal 'tobi', @context['hash.name'] assert_equal 'tobi', @context['hash["name"]']
|
public AddFilters ( IEnumerable |
||
filters | IEnumerable |
|
return | void |
public Context ( List |
||
environments | List |
|
outerScope | Hash | |
registers | Hash | |
rethrowErrors | bool | |
return | System |
public GetValueTypeTransformer ( |
||
type | ||
return | object>.Func |
public HandleError ( |
||
ex | ||
return | string |
public Stack ( System.Action callback ) : void | ||
callback | System.Action | |
return | void |
public Stack ( Hash newScope, System.Action callback ) : void | ||
newScope | Hash | |
callback | System.Action | |
return | void |