UtopiaSourceUtopiaContentNamespace

module Namespace

A namespace which contains tags which can be rendered within a class Utopia::Content::Document.

Definitions

def self.extended(other)

Initialize tag mappings on an extended namespace.

Signature

parameter other Module

The namespace being extended.

returns Hash

The initialized tag mappings.

Implementation

def self.extended(other)
	other.class_exec do
		@named = {}
	end
end

def freeze

Freeze this object and its internal state.

Signature

returns self

This object.

Implementation

def freeze
	return self if frozen?
	
	@named.freeze
	@named.values.each(&:freeze)
	
	super
end

def tag(name, klass = nil, &block)

Tag.

Signature

parameter name String

The name.

parameter klass Class

The class to configure.

returns Class | Proc

The registered tag implementation.

Implementation

def tag(name, klass = nil, &block)
	@named[name] = klass || block
end

def call(name, node)

Implementation

def call(name, node)
	@named[name]
end