Class: Amrita2::Filters::Format

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(format) ⇒ Format

Returns a new instance of Format.



2147
2148
2149
# File 'lib/amrita2/template.rb', line 2147

def initialize(format)
  @format = format
end

Instance Method Details

#value_filter_code(de, cg, value) ⇒ Object



2150
2151
2152
2153
# File 'lib/amrita2/template.rb', line 2150

def value_filter_code(de, cg, value)
  cg.code("$_ = #{@format.inspect} % $_")
  super
end