Sha256: dd0d2b6def2b51f0f948918157ec7afd4555be941f56ebb517cb79dfe29f372d
Contents?: true
Size: 429 Bytes
Versions: 6
Compression:
Stored size: 429 Bytes
Contents
module AutoHtml class Builder @@filters = {} def initialize(text) @text = text.dup end def self.add_filter(name, &block) filter = Filter.new(block) @@filters.merge!(name => filter) src = %| def #{name}(options = {}) @text = @@filters["#{name}".to_sym].apply(@text, options) end | class_eval src, __FILE__, __LINE__ filter end end end
Version data entries
6 entries across 6 versions & 2 rubygems