Class: WSDL::Parser::CachedResult Private
- Inherits:
-
Object
- Object
- WSDL::Parser::CachedResult
- Defined in:
- lib/wsdl/parser/cached_result.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Loads parser results with cache-aware keying.
Cache key correctness is enforced by WSDL::ParseOptions, the immutable value object that captures every parse-affecting option. Both the cache key and Result.parse receive the same WSDL::ParseOptions instance (via ParseInputs), so they can never diverge.
Adding a new parse-affecting parameter requires two steps:
- Add the member to WSDL::ParseOptions (
lib/wsdl/parse_options.rb). - Add its normalization to CachedResult.cache_key in this file.
Defined Under Namespace
Classes: ParseInputs
Constant Summary collapse
- CACHE_KEY_VERSION =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Cache key schema version.
Bump this when the key format changes (e.g. new normalization logic). Adding a new member to WSDL::ParseOptions also warrants a bump so that entries cached by an older version are not reused.
10
Instance Attribute Summary collapse
-
#http ⇒ Object
readonly
HTTP adapter instance.
-
#parse_options ⇒ ParseOptions
readonly
Parse configuration options.
-
#wsdl ⇒ String
readonly
WSDL location (HTTP(S) URL or local file path).
Class Method Summary collapse
-
.load(wsdl:, http:, cache:, parse_options:) ⇒ Result
private
Loads a parser result, using cache when available.
Instance Attribute Details
#http ⇒ Object (readonly)
45 |
# File 'lib/wsdl/parser/cached_result.rb', line 45 ParseInputs = Data.define(:wsdl, :http, :parse_options) |
#parse_options ⇒ ParseOptions (readonly)
45 |
# File 'lib/wsdl/parser/cached_result.rb', line 45 ParseInputs = Data.define(:wsdl, :http, :parse_options) |
#wsdl ⇒ String (readonly)
45 |
# File 'lib/wsdl/parser/cached_result.rb', line 45 ParseInputs = Data.define(:wsdl, :http, :parse_options) |
Class Method Details
.load(wsdl:, http:, cache:, parse_options:) ⇒ Result
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Loads a parser result, using cache when available.
56 57 58 59 60 61 62 63 |
# File 'lib/wsdl/parser/cached_result.rb', line 56 def load(wsdl:, http:, cache:, parse_options:) inputs = ParseInputs.new(wsdl:, http:, parse_options:) cache = WSDL.cache if cache.nil? return build_result(inputs) unless cache cache.fetch(cache_key(inputs)) { build_result(inputs) } end |