Class: Amrita2::Filters::Repeat

Inherits:
Base show all
Defined in:
lib/amrita2/template.rb

Instance Attribute Summary

Attributes inherited from Base

#next_

Instance Method Summary collapse

Methods inherited from Base

filter_method, inherited, #parse_filter_a, #|

Constructor Details

#initialize(cnt) ⇒ Repeat

Returns a new instance of Repeat.



2136
2137
2138
# File 'lib/amrita2/template.rb', line 2136

def initialize(cnt)
  @cnt = cnt.to_i
end

Instance Method Details

#value_filter_code(de, cg, value) ⇒ Object



2140
2141
2142
2143
# File 'lib/amrita2/template.rb', line 2140

def value_filter_code(de, cg, value)
  cg.code("$_ = $_ * #@cnt  ")
  super
end