Class: Arrow::Template::ElseDirective

Inherits:
Directive show all
Defined in:
lib/arrow/template/else.rb

Overview

The Arrow::Template::ElseDirective class, a derivative of Arrow::Template::Directive. This is the class which defines the behaviour of the ‘else’ template directive.

Authors

Please see the file LICENSE in the top-level directory for licensing details.

Constant Summary collapse

SVNRev =

SVN Revision

%q$Rev$
SVNId =

SVN Id

%q$Id$

Constants included from HTMLUtilities

HTMLUtilities::ARRAY_HTML_CONTAINER, HTMLUtilities::HASH_HTML_CONTAINER, HTMLUtilities::HASH_PAIR_HTML, HTMLUtilities::IMMEDIATE_OBJECT_HTML_CONTAINER, HTMLUtilities::IVAR_HTML_FRAGMENT, HTMLUtilities::OBJECT_HTML_CONTAINER, HTMLUtilities::THREAD_DUMP_KEY

Instance Attribute Summary

Attributes inherited from Node

#type

Instance Method Summary collapse

Methods inherited from Directive

create, derivativeDirs, #inspect, #render, #to_html

Methods inherited from Node

#add_to_template, #inspect, #is_rendering_node?, #render, #to_a, #to_html, #to_s

Methods included from HTMLUtilities

escape_html, make_html_for_object, make_object_html_wrapper

Methods inherited from Object

deprecate_class_method, deprecate_method, inherited

Constructor Details

#initialize(body, parser, state) ⇒ ElseDirective

Create a new Arrow::Template::ElsifDirective object.



31
32
33
34
35
36
37
38
39
# File 'lib/arrow/template/else.rb', line 31

def initialize( body, parser, state )
	unless state.current_branch_node.is_a?( Arrow::Template::ConditionalDirective )
		raise Arrow::TemplateError,
			"else outside of conditional directive (%p)" %
			state.current_branch_node
	end
		
	super
end