Class: Codex::Filter

Inherits:
Object
  • Object
show all
Defined in:
lib/codex/filter.rb

Overview

Filter is an abstract class for user defined filters. It lets them declare the tag they wish to use. When declaring a tag, it also registers with Filters.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#tagObject

Returns the value of attribute tag.



8
9
10
# File 'lib/codex/filter.rb', line 8

def tag
  @tag
end

Class Method Details

.tag(tag) ⇒ Object



9
10
11
12
# File 'lib/codex/filter.rb', line 9

def self.tag(tag)
  @tag = tag
  Filters.instance[tag] = self.new
end