Class: MetaCL::Templates::Aggregator

Inherits:
Mustache
  • Object
show all
Defined in:
lib/metacl/templates/aggregator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



4
5
6
# File 'lib/metacl/templates/aggregator.rb', line 4

def code
  @code
end

#fromObject (readonly)

Returns the value of attribute from.



4
5
6
# File 'lib/metacl/templates/aggregator.rb', line 4

def from
  @from
end

#iteratorObject (readonly)

Returns the value of attribute iterator.



4
5
6
# File 'lib/metacl/templates/aggregator.rb', line 4

def iterator
  @iterator
end

#operatorObject (readonly)

Returns the value of attribute operator.



4
5
6
# File 'lib/metacl/templates/aggregator.rb', line 4

def operator
  @operator
end

#subresult_varObject (readonly)

Returns the value of attribute subresult_var.



4
5
6
# File 'lib/metacl/templates/aggregator.rb', line 4

def subresult_var
  @subresult_var
end

#toObject (readonly)

Returns the value of attribute to.



4
5
6
# File 'lib/metacl/templates/aggregator.rb', line 4

def to
  @to
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/metacl/templates/aggregator.rb', line 4

def type
  @type
end

#varObject (readonly)

Returns the value of attribute var.



4
5
6
# File 'lib/metacl/templates/aggregator.rb', line 4

def var
  @var
end

Instance Method Details

#render(platform, options = {}) ⇒ Object



6
7
8
9
10
# File 'lib/metacl/templates/aggregator.rb', line 6

def render(platform, options = {})
  @type, @var, @iterator, @from, @to, @subresult_var, @operator, @code = options.values_at(:type, :var, :iterator, :from, :to, :subresult_var, :operator, :code)
  @code = Utils.tab_text(@code)
  super IO.read("#{__dir__}/aggregator.any.template")
end