Class: REXML::CSSSelector::QueryContext
- Inherits:
-
Object
- Object
- REXML::CSSSelector::QueryContext
- Defined in:
- lib/rexml/css_selector/query_context.rb
Overview
QueryContext is a context on matching CSS selector.
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#cache ⇒ Object
readonly
Returns the value of attribute cache.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#substitutions ⇒ Object
readonly
Returns the value of attribute substitutions.
Instance Method Summary collapse
-
#initialize(scope:, substitutions:, adapter:, options:) ⇒ QueryContext
constructor
A new instance of QueryContext.
- #scoped(new_scope) ⇒ Object
Constructor Details
#initialize(scope:, substitutions:, adapter:, options:) ⇒ QueryContext
Returns a new instance of QueryContext.
7 8 9 10 11 12 13 |
# File 'lib/rexml/css_selector/query_context.rb', line 7 def initialize(scope:, substitutions:, adapter:, options:) @scope = scope @substitutions = substitutions @adapter = adapter @options = @cache = {} end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
15 16 17 |
# File 'lib/rexml/css_selector/query_context.rb', line 15 def adapter @adapter end |
#cache ⇒ Object (readonly)
Returns the value of attribute cache.
15 16 17 |
# File 'lib/rexml/css_selector/query_context.rb', line 15 def cache @cache end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
15 16 17 |
# File 'lib/rexml/css_selector/query_context.rb', line 15 def @options end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
15 16 17 |
# File 'lib/rexml/css_selector/query_context.rb', line 15 def scope @scope end |
#substitutions ⇒ Object (readonly)
Returns the value of attribute substitutions.
15 16 17 |
# File 'lib/rexml/css_selector/query_context.rb', line 15 def substitutions @substitutions end |
Instance Method Details
#scoped(new_scope) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/rexml/css_selector/query_context.rb', line 17 def scoped(new_scope) old_scope = @scope @scope = new_scope yield @scope = old_scope end |