Sha256: db8babf0a9f8ad3cb468791641c06804df49a0b2ed75a84be095de9d3d2929aa

Contents?: true

Size: 609 Bytes

Versions: 2

Compression:

Stored size: 609 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.alcn}> found in <#{context.content_node.alcn}>" }
      end
      output
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gettalong-webgen-0.5.9.20090620 lib/webgen/tag/metainfo.rb
gettalong-webgen-0.5.9.20090626 lib/webgen/tag/metainfo.rb