Class: CSS::Selectors::Matcher::Context

Inherits:
Data
  • Object
show all
Defined in:
lib/css/selectors/matcher.rb

Overview

Per-element cache used to avoid recomputing tag / id / class set for every selector in a hot loop (e.g. ‘Cascade#resolve` against hundreds of rules). Keyed by `Object#object_id`; only valid for the duration of a single matcher invocation.

Instance Attribute Summary collapse

Instance Attribute Details

#classesObject (readonly)

Returns the value of attribute classes

Returns:

  • (Object)

    the current value of classes



33
34
35
# File 'lib/css/selectors/matcher.rb', line 33

def classes
  @classes
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



33
34
35
# File 'lib/css/selectors/matcher.rb', line 33

def id
  @id
end

#tagObject (readonly)

Returns the value of attribute tag

Returns:

  • (Object)

    the current value of tag



33
34
35
# File 'lib/css/selectors/matcher.rb', line 33

def tag
  @tag
end