Module: Yuzu::Filters
- Included in:
- Core::WebsiteFile, Generators
- Defined in:
- lib/yuzu/filters/base.rb,
lib/yuzu/filters/images.rb,
lib/yuzu/filters/catalog.rb,
lib/yuzu/filters/sidebar.rb,
lib/yuzu/filters/linkroot.rb,
lib/yuzu/filters/template.rb,
lib/yuzu/filters/extension.rb,
lib/yuzu/filters/post_date.rb,
lib/yuzu/filters/categories.rb,
lib/yuzu/filters/post_title.rb,
lib/yuzu/filters/currentpath.rb,
lib/yuzu/filters/description.rb,
lib/yuzu/filters/post_title_removed.rb
Defined Under Namespace
Classes: Catalog, CatalogFilter, CategoriesFilter, Category, CurrentpathFilter, DescriptionFilter, ExtensionFilter, Filter, ImagesFilter, LinkrootFilter, PostDateFilter, PostTitleFilter, PostTitleRemovedFilter, SidebarFilter, TemplateFilter
Constant Summary
Constants included from Core
Core::BOLD, Core::ENDC, Core::WHITE
Class Method Summary collapse
-
.catalog_for(website_file, match_string) ⇒ Catalog
Create a Catalog instance for a given match.
-
.get_kwds(match_string) ⇒ Hash
Returns a Hash of the keyword arguments contained in the inner match string of the tag:.
Methods included from Core
Class Method Details
.catalog_for(website_file, match_string) ⇒ Catalog
Create a Catalog instance for a given match
38 39 40 41 |
# File 'lib/yuzu/filters/catalog.rb', line 38 def catalog_for(website_file, match_string) kwds = Yuzu::Filters.get_kwds(match_string) Catalog.new(kwds, website_file, match_string) end |
.get_kwds(match_string) ⇒ Hash
Returns a Hash of the keyword arguments contained in the inner match string of the tag:
INSERTCATALOG(page: 1, count:10)
yields
{:page => 1, :count => 10}
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/yuzu/filters/catalog.rb', line 54 def get_kwds(match_string) pairs = match_string.split(",").collect {|pair| pair.strip} kwds = {} pairs.each do |pair| key, val = pair.split(":").collect {|el| el.strip} kwds[key.to_sym] = val end kwds end |