Sha256: d0b0ce57cd1978d58b2911245608e300e2f512039063cfbf39dd61c878670551

Contents?: true

Size: 610 Bytes

Versions: 3

Compression:

Stored size: 610 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(:error) { "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

3 entries across 3 versions & 1 rubygems

Version Path
webgen-0.5.11 lib/webgen/tag/metainfo.rb
webgen-0.5.10 lib/webgen/tag/metainfo.rb
webgen-0.5.9 lib/webgen/tag/metainfo.rb