Class: Amrita2::Filters::Format
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(format) ⇒ Format
constructor
A new instance of Format.
- #value_filter_code(de, cg, value) ⇒ Object
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 |