Class: WSDL::Parser::CachedResult Private

Inherits:
Object
  • Object
show all
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:

  1. Add the member to WSDL::ParseOptions (lib/wsdl/parse_options.rb).
  2. Add its normalization to CachedResult.cache_key in this file.

API:

  • private

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.

API:

  • private

10

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#httpObject (readonly)



45
# File 'lib/wsdl/parser/cached_result.rb', line 45

ParseInputs = Data.define(:wsdl, :http, :parse_options)

#parse_optionsParseOptions (readonly)



45
# File 'lib/wsdl/parser/cached_result.rb', line 45

ParseInputs = Data.define(:wsdl, :http, :parse_options)

#wsdlString (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.

API:

  • private



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