struct Crinja::Arguments

Overview

This holds arguments and environment information for function, filter, test and macro calls.

Defined in:

arguments.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(env : Crinja, varargs : Array(Crinja::Value) = [] of Value, kwargs : Hash(String, Crinja::Value) = Hash(String, Value).new, defaults : Hash(String, Crinja::Value) = Variables.new, target : Crinja::Value | Nil = nil) #

Instance Method Detail

def [](name : String) : Value #

def default(name : Symbol) #

def default(name : String) #

def defaults : Variables #

Default argument values defined by the call implementation.


def env : Crinja #

Returns the crinja environment.


def fetch(name, default : Value) #

def fetch(name, default = nil) #

def fetch(name, &) #

def is_set?(name : Symbol) #

def is_set?(name : String) #

def kwargs : Hash(String, Value) #

Returns the keyword arguments of the call.


def target : Value | Nil #

Returns the target of the call (if any).


def target! #

def to_h #

def varargs : Array(Value) #

Returns the variable arguments of the call.