Class: Utopia::Content::Tags::Library

Inherits:
Object
  • Object
show all
Defined in:
lib/utopia/content/tags/library.rb

Overview

A library of tags which can be installed as a namespace into Utopia::Content.

Instance Method Summary collapse

Constructor Details

#initialize(tags) ⇒ Library

Returns a new instance of Library

Parameters:

  • tags (Hash<String,Proc>)

    A map of tag names to callable objects.



28
29
30
# File 'lib/utopia/content/tags/library.rb', line 28

def initialize(tags)
	@tags = tags
end

Instance Method Details

#call(name, node) ⇒ Object

Parameters:

  • name (String)

    The name of the tag.

  • node (Utopia::Content::Node)

    The node that caused this tag to be evaluated.



34
35
36
# File 'lib/utopia/content/tags/library.rb', line 34

def call(name, node)
	return @tags[name].call(name, node)
end