C# 클래스 DotLiquid.Context

파일 보기 프로젝트 열기: NewSpring/Rock 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
ValueTypeTransformers Dictionary>

공개 메소드들

메소드 설명
AddFilters ( ) : void
AddFilters ( IEnumerable filters ) : void

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 environments, Hash outerScope, Hash registers, bool rethrowErrors ) : System
GetValueTypeTransformer ( Type type ) : object>.Func
HandleError ( Exception ex ) : string
HasKey ( string key ) : bool
Invoke ( string method, List args ) : object
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

비공개 메소드들

메소드 설명
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"]']

메소드 상세

AddFilters() 공개 메소드

public AddFilters ( ) : void
리턴 void

AddFilters() 공개 메소드

Adds filters to this context. this does not register the filters with the main Template object. see Template.register_filter for that
public AddFilters ( IEnumerable filters ) : void
filters IEnumerable
리턴 void

ClearInstanceAssigns() 공개 메소드

public ClearInstanceAssigns ( ) : void
리턴 void

Context() 공개 메소드

public Context ( ) : System
리턴 System

Context() 공개 메소드

public Context ( List environments, Hash outerScope, Hash registers, bool rethrowErrors ) : System
environments List
outerScope Hash
registers Hash
rethrowErrors bool
리턴 System

GetValueTypeTransformer() 공개 메소드

public GetValueTypeTransformer ( Type type ) : object>.Func
type System.Type
리턴 object>.Func

HandleError() 공개 메소드

public HandleError ( Exception ex ) : string
ex System.Exception
리턴 string

HasKey() 공개 메소드

public HasKey ( string key ) : bool
key string
리턴 bool

Invoke() 공개 메소드

public Invoke ( string method, List args ) : object
method string
args List
리턴 object

Merge() 공개 메소드

Merge a hash of variables in the current local scope
public Merge ( Hash newScopes ) : void
newScopes Hash
리턴 void

Pop() 공개 메소드

Pop from the stack. use Context#stack instead
public Pop ( ) : Hash
리턴 Hash

Push() 공개 메소드

Push new local scope on the stack. use Context#stack instead
public Push ( Hash newScope ) : void
newScope Hash
리턴 void

Stack() 공개 메소드

public Stack ( System.Action callback ) : void
callback System.Action
리턴 void

Stack() 공개 메소드

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
public Stack ( Hash newScope, System.Action callback ) : void
newScope Hash
callback System.Action
리턴 void

this() 공개 메소드

Only allow String, Numeric, Hash, Array, Proc, Boolean or Liquid::Drop
public this ( string key ) : object
key string
리턴 object

프로퍼티 상세

ValueTypeTransformers 공개적으로 프로퍼티

public Dictionary> ValueTypeTransformers
리턴 Dictionary>