Class: ESI::Tag::Include
Defined Under Namespace
Classes: Request
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#depth ⇒ Object
Returns the value of attribute depth.
-
#max_depth ⇒ Object
Returns the value of attribute max_depth.
Attributes inherited from Base
#attributes, #cache, #children, #closed, #name
Instance Method Summary collapse
- #close(output, options = {}) ⇒ Object
-
#initialize(uri, headers, http_params, name, attrs, cache) ⇒ Include
constructor
A new instance of Include.
- #parse_fragment? ⇒ Boolean
Methods inherited from Base
#buffer, create, #prepare_url_vars
Methods included from Log
#log, #log_debug, #log_error, #log_request, #msg
Constructor Details
#initialize(uri, headers, http_params, name, attrs, cache) ⇒ Include
Returns a new instance of Include.
71 72 73 74 75 |
# File 'lib/esi/tag/include.rb', line 71 def initialize(uri,headers,http_params,name,attrs,cache) super @depth = 0 @max_depth = 3 end |
Instance Attribute Details
#depth ⇒ Object
Returns the value of attribute depth.
69 70 71 |
# File 'lib/esi/tag/include.rb', line 69 def depth @depth end |
#max_depth ⇒ Object
Returns the value of attribute max_depth.
69 70 71 |
# File 'lib/esi/tag/include.rb', line 69 def max_depth @max_depth end |
Instance Method Details
#close(output, options = {}) ⇒ Object
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/esi/tag/include.rb', line 81 def close( output, = {} ) super(output) @output = output raise_on_error = [:raise] || false # default to false src = @router.url_for(prepare_url_vars(@attributes["src"])) alt = @attributes['alt'] alt = @router.url_for(prepare_url_vars(alt)) if alt prepare_parser if @cache.cached?( src, @http_params ) send_from_cache( src ) else send_from_origin( src, alt, raise_on_error ) end end |
#parse_fragment? ⇒ Boolean
77 78 79 |
# File 'lib/esi/tag/include.rb', line 77 def parse_fragment? @depth <= @max_depth end |