Class: Arrow::Template::ElsifDirective

Inherits:
AttributeDirective show all
Includes:
ConditionalDirective
Defined in:
lib/arrow/template/elsif.rb

Overview

The Arrow::Template::ElsifDirective class, a derivative of Arrow::Template::Directive. This is the class which defines the behaviour of the ‘elsif’ 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 AttributeDirective

#format, #methodchain, #name

Attributes inherited from Node

#type

Instance Method Summary collapse

Methods included from ConditionalDirective

#evaluate, #is_rendering_node?

Methods inherited from AttributeDirective

allows_format?, #before_rendering, #inspect, #is_rendering_node?, #render, #to_html

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) ⇒ ElsifDirective

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



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

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