Class: Yuzu::Filters::LinkrootFilter
Instance Attribute Summary
Attributes inherited from Filter
#directive, #name
Instance Method Summary
collapse
Methods inherited from Filter
#default, filters, #match, #process, registry, #value
Constructor Details
Returns a new instance of LinkrootFilter.
5
6
7
8
|
# File 'lib/yuzu/filters/linkroot.rb', line 5
def initialize
@name = :linkroot
@directive = "LINKROOT"
end
|
Instance Method Details
#filter_type ⇒ Object
10
11
12
13
14
|
# File 'lib/yuzu/filters/linkroot.rb', line 10
def filter_type
[:prefilter, :postfilter]
end
|
#get_match(contents) ⇒ Object
24
25
26
27
|
# File 'lib/yuzu/filters/linkroot.rb', line 24
def get_match(contents)
m = contents.match(regex)
m.nil? ? nil : m[0]
end
|
#get_value(website_file) ⇒ Object
20
21
22
|
# File 'lib/yuzu/filters/linkroot.rb', line 20
def get_value(website_file)
website_file.config.linkroot
end
|
16
17
18
|
# File 'lib/yuzu/filters/linkroot.rb', line 16
def regex
/LINKROOT/
end
|
#replacement(website_file, processing_contents = nil) ⇒ Object
29
30
31
|
# File 'lib/yuzu/filters/linkroot.rb', line 29
def replacement(website_file, processing_contents=nil)
website_file.config.linkroot
end
|