Class: Yuzu::Filters::CatalogFilter

Inherits:
Filter show all
Defined in:
lib/yuzu/filters/catalog.rb

Instance Attribute Summary

Attributes inherited from Filter

#directive, #name

Instance Method Summary collapse

Methods inherited from Filter

#default, #filter_type, filters, #get_match, #get_value, #match, #process, #regex, registry

Constructor Details

#initializeCatalogFilter

Returns a new instance of CatalogFilter.



11
12
13
14
# File 'lib/yuzu/filters/catalog.rb', line 11

def initialize
  @name = :catalog
  @directive = "INSERTCATALOG"
end

Instance Method Details

#replacement(website_file, processing_contents = nil) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/yuzu/filters/catalog.rb', line 20

def replacement(website_file, processing_contents=nil)
  catalog = Yuzu::Filters.catalog_for(website_file, match(processing_contents))

  if catalog.should_paginate? and catalog.num_pages > 1
    website_file.stash(:catalog => catalog)
  end

  return catalog.render
end

#value(website_file) ⇒ Object



16
17
18
# File 'lib/yuzu/filters/catalog.rb', line 16

def value(website_file)
  nil
end