Class: Yuzu::Filters::CurrentpathFilter
Instance Attribute Summary
Attributes inherited from Filter
#directive, #name
Instance Method Summary
collapse
Methods inherited from Filter
#default, filters, #get_match, #match, #process, registry, #value
Constructor Details
Returns a new instance of CurrentpathFilter.
8
9
10
11
|
# File 'lib/yuzu/filters/currentpath.rb', line 8
def initialize
@name = :currentpath
@directive = "CURRENTPATH"
end
|
Instance Method Details
#filter_type ⇒ Object
13
14
15
16
17
|
# File 'lib/yuzu/filters/currentpath.rb', line 13
def filter_type
[:prefilter, :postfilter]
end
|
#get_value(website_file) ⇒ Object
23
24
25
26
27
|
# File 'lib/yuzu/filters/currentpath.rb', line 23
def get_value(website_file)
linkroot = website_file.config.linkroot
pathname = website_file.path.dirname
Url.new(pathname, prefix=linkroot)
end
|
19
20
21
|
# File 'lib/yuzu/filters/currentpath.rb', line 19
def regex
/CURRENTPATH/
end
|
#replacement(website_file, processing_contents = nil) ⇒ Object
29
30
31
|
# File 'lib/yuzu/filters/currentpath.rb', line 29
def replacement(website_file, processing_contents=nil)
get_value(website_file)
end
|