Sha256: 098cf3742bc56f881e3c4e33bb86bee059994f266695016c83153666218c21d3

Contents?: true

Size: 620 Bytes

Versions: 7

Compression:

Stored size: 620 Bytes

Contents

require 'webgen/tag'

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

7 entries across 7 versions & 2 rubygems

Version Path
gettalong-webgen-0.5.4.20080929 lib/webgen/tag/metainfo.rb
gettalong-webgen-0.5.5.20081001 lib/webgen/tag/metainfo.rb
webgen-0.5.1 lib/webgen/tag/metainfo.rb
webgen-0.5.4 lib/webgen/tag/metainfo.rb
webgen-0.5.2 lib/webgen/tag/metainfo.rb
webgen-0.5.3 lib/webgen/tag/metainfo.rb
webgen-0.5.5 lib/webgen/tag/metainfo.rb