Class: LtdTemplate::Value::Array_Splat

Inherits:
Object
  • Object
show all
Includes:
Method_Handler
Defined in:
lib/ltdtemplate/value/array_splat.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(positional, named = nil) ⇒ Array_Splat

Returns a new instance of Array_Splat.

Parameters:

  • positional (Array)

    Positional parameters

  • named (Array) (defaults to: nil)

    Flat array of key, value pairs



15
16
17
# File 'lib/ltdtemplate/value/array_splat.rb', line 15

def initialize (positional, named = nil)
	@positional, @named = positional, named
end

Instance Attribute Details

#namedObject (readonly)

Returns the value of attribute named.



11
12
13
# File 'lib/ltdtemplate/value/array_splat.rb', line 11

def named
  @named
end

#positionalObject (readonly)

Returns the value of attribute positional.



11
12
13
# File 'lib/ltdtemplate/value/array_splat.rb', line 11

def positional
  @positional
end

Instance Method Details

#evaluate(opts = {}) ⇒ Object

Evaluate support array splat methods. Very little is supported, as these are only intended to be used in parameter and subscript list expansions.



22
23
24
25
26
27
# File 'lib/ltdtemplate/value/array_splat.rb', line 22

def evaluate (opts = {})
	case opts[:method]
	when 'type' then 'array_splat'
	else nil
	end
end

#tpl_textObject

Unlike arrays, these generate no template text.



30
# File 'lib/ltdtemplate/value/array_splat.rb', line 30

def tpl_text; ''; end