class Genit::ClassTag

A Genit general tag.

Public Class Methods

new(working_dir, template, filename, tag) click to toggle source

Public: Constructor.

working_dir - The String working directory, where live the project. template - The Nokogiri::XML::Document into which we process the tag. filename - The String name of the page tag - The tag to process as a Nokogiri::XML::Element

Calls superclass method
# File lib/genit/tags/class_tag.rb, line 13
def initialize working_dir, template, filename, tag
  super working_dir, template, filename, tag
end

Public Instance Methods

process() click to toggle source

Public: Replace something in the template.

Returns the template as a Nokogiri::XML::Document

# File lib/genit/tags/class_tag.rb, line 20
def process
  case @tag['class']
    when 'pages' then ClassPagesTag.new(@working_dir, @template, @filename, @tag).process
    when 'menu' then ClassMenuTag.new(@working_dir, @template, @filename, @tag).process
    when 'fragment' then ClassFragmentTag.new(@working_dir, @template, @filename, @tag).process
    when 'news' then ClassNewsTag.new(@working_dir, @template, @filename, @tag).process
    else
      error "Unknown tag #{@tag}"
  end
end