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

  • Michael Granger

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

Constant Summary

SVNRev =

SVN Revision

%q$Rev$
SVNId =

SVN Id

%q$Id$

Constants inherited from Directive

SVNId, SVNRev

Constants inherited from Node

SVNId, SVNRev

Constants included from Arrow::HTMLUtilities

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

Instance Method Summary

Methods inherited from Directive

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

Methods inherited from Node

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

Methods included from Arrow::HTMLUtilities

#escape_html, #make_html_for_object, #make_object_html_wrapper

Methods inherited from Arrow::Object

deprecate_class_method, deprecate_method, inherited

Methods included from Arrow::Loggable

#log

Constructor Details

- (ElseDirective) initialize(body, parser, state)

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