Class: Yuzu::PostProcessors::AllCategoriesPostProcessor
Instance Attribute Summary
#name
Instance Method Summary
collapse
#match, postprocessors, registry
Constructor Details
Returns a new instance of AllCategoriesPostProcessor.
7
8
9
|
# File 'lib/yuzu/postprocessors/all_categories.rb', line 7
def initialize
@name = :all_categories
end
|
Instance Method Details
#default_value(website_file) ⇒ Object
14
15
16
|
# File 'lib/yuzu/postprocessors/all_categories.rb', line 14
def default_value(website_file)
[]
end
|
#get_value(website_file) ⇒ Object
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/yuzu/postprocessors/all_categories.rb', line 24
def get_value(website_file)
cats = []
found_names = []
v = Yuzu::Core::Visitor.new(proc {|c| c.file?})
v.traverse(website_file.root) do |f|
f.categories.each do |cat|
if not found_names.include?(cat.name) and not cat.name == "uncategorized"
found_names.push(cat.name)
cats.push(cat)
end
end
end
cats.sort
end
|
11
12
|
# File 'lib/yuzu/postprocessors/all_categories.rb', line 11
def regex
end
|
#value(website_file) ⇒ Object
18
19
20
21
22
|
# File 'lib/yuzu/postprocessors/all_categories.rb', line 18
def value(website_file)
@value ||= get_value(website_file)
end
|