Class: ESI::Tag::Except

Inherits:
Container show all
Defined in:
lib/esi/tag/except.rb

Constant Summary

Constants inherited from Base

Base::Validate

Instance Attribute Summary collapse

Attributes inherited from Container

#cache, #children, #closed, #name

Attributes inherited from Base

#attributes, #cache, #children, #closed, #name

Instance Method Summary collapse

Methods inherited from Container

#close_child

Methods included from Log

#log, #log_debug, #log_error, #log_request, #msg

Methods inherited from Base

#close, create, #prepare_url_vars

Constructor Details

#initialize(uri, headers, http_params, name, attrs, cache) ⇒ Except

Returns a new instance of Except.



10
11
12
13
14
15
# File 'lib/esi/tag/except.rb', line 10

def initialize(uri,headers,http_params,name,attrs,cache)
  super
  @buffers = [] # buffer output since this may only appear if the attempt block fails first
  @buffer_index = 0
  @buffers[@buffer_index] = ""
end

Instance Attribute Details

#buffersObject (readonly)

Returns the value of attribute buffers.



8
9
10
# File 'lib/esi/tag/except.rb', line 8

def buffers
  @buffers
end

Instance Method Details

#add_child(tag) ⇒ Object



17
18
19
20
21
# File 'lib/esi/tag/except.rb', line 17

def add_child(tag)
  super(tag)
  @buffer_index += 1
  @buffers[@buffer_index] = ""
end

#buffer(output, inner_html) ⇒ Object



23
24
25
# File 'lib/esi/tag/except.rb', line 23

def buffer( output, inner_html )
  @buffers[@buffer_index] << inner_html
end