Class: EsiForRack::Node::Try
Constant Summary
IncludeFailedError
Instance Attribute Summary
#context, #node
Instance Method Summary
collapse
#execute_in_place!, #init
Instance Method Details
#execute ⇒ Object
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# File 'lib/esi_for_rack/node.rb', line 49
def execute
unless @esi_attempt = node.css('esi_attempt')[0]
raise "no attempt within try"
end
unless @esi_except = node.css('esi_except')[0]
raise "no except within try"
end
val = ''
begin
context.process(@esi_attempt)
@esi_attempt.inner_html
rescue IncludeFailedError
context.process(@esi_except)
@esi_except.inner_html
end
end
|