Sha256: 78f116308fcbe27d58c75a6f873721fe3d401475948b1924878927c33ae58c44

Contents?: true

Size: 625 Bytes

Versions: 5

Compression:

Stored size: 625 Bytes

Contents

# -*- encoding: utf-8 -*-

module Webgen::Tag

  # Provides easy access to the meta information of a node.
  class Metainfo

    include Base

    # Return the meta information key specified in +tag+ of the content node.
    def call(tag, body, context)
      output = ''
      if tag == 'lang'
        output = context.content_node.lang
      elsif context.content_node[tag]
        output = context.content_node[tag].to_s
      else
        log(:warn) { "No value for meta info key '#{tag}' in <#{context.ref_node.absolute_lcn}> found in <#{context.content_node.absolute_lcn}>" }
      end
      output
    end

  end

end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
gettalong-webgen-0.5.7.20090227 lib/webgen/tag/metainfo.rb
gettalong-webgen-0.5.8.20090507 lib/webgen/tag/metainfo.rb
thewoolleyman-webgen-0.5.8.20090419 lib/webgen/tag/metainfo.rb
webgen-0.5.7 lib/webgen/tag/metainfo.rb
webgen-0.5.8 lib/webgen/tag/metainfo.rb