Class: Webgen::Tag::Metainfo
- Inherits:
-
Object
- Object
- Webgen::Tag::Metainfo
- Includes:
- Base
- Defined in:
- lib/webgen/tag/metainfo.rb
Overview
Provides easy access to the meta information of a node.
Instance Method Summary collapse
-
#call(tag, body, context) ⇒ Object
Return the meta information key specified in
tag
of the content node.
Methods included from Base
#create_params_hash, #create_tag_params, #param, #set_params
Methods included from WebsiteAccess
Methods included from Loggable
Instance Method Details
#call(tag, body, context) ⇒ Object
Return the meta information key specified in tag
of the content node.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/webgen/tag/metainfo.rb', line 11 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 |