Module: Saxon::XPath::StaticContext::Common Private

Included in:
Saxon::XPath::StaticContext, DSL
Defined in:
lib/saxon/xpath/static_context.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

methods used by both Saxon::XPath::StaticContext and DSL

Instance Method Summary collapse

Instance Method Details

#args_hashHash<Symbol => Hash,null>

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.

returns the context details in a hash suitable for initializing a new one

Returns:

  • (Hash<Symbol => Hash,null>)

    the args hash



38
39
40
41
42
43
44
# File 'lib/saxon/xpath/static_context.rb', line 38

def args_hash
  {
    declared_namespaces: @declared_namespaces,
    declared_variables: @declared_variables,
    default_collation: @default_collation
  }
end

#initialize(args = {}) ⇒ Object

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.

Parameters:

  • args (Hash) (defaults to: {})

Options Hash (args):

  • :declared_variables (Hash<Saxon::QName => Saxon::XPath::VariableDeclaration>)

    Hash of declared variables

  • :declared_namespaces (Hash<String => String>)

    Hash of namespace bindings prefix => URI

  • :declared_collations (Hash<String => java.text.Collator>)

    Hash of URI => Collator bindings

  • :default_collation (String)

    URI of the default collation



30
31
32
33
34
# File 'lib/saxon/xpath/static_context.rb', line 30

def initialize(args = {})
  @declared_variables = args.fetch(:declared_variables, {}).freeze
  @declared_namespaces = args.fetch(:declared_namespaces, {}).freeze
  @default_collation = args.fetch(:default_collation, nil).freeze
end