Class: CSS::Selectors::AttributeSelector
- Inherits:
-
Data
- Object
- Data
- CSS::Selectors::AttributeSelector
- Includes:
- Node
- Defined in:
- lib/css/selectors/nodes.rb
Overview
Attribute matchers:
nil — `[name]` (presence)
:exact — `[a=b]`
:includes — `[a~=b]`
:dash — `[a|=b]`
:prefix — `[a^=b]`
:suffix — `[a$=b]`
:substring — `[a*=b]`
‘case_flag` is `nil`, `:i`, or `:s`. `namespace` is the attribute namespace constraint (`nil` = no prefix, `’*‘` = any, `”` = no namespace); a declared prefix is rejected. Attribute namespaces aren’t tracked at match time (HTML attributes are all in no namespace), so matching is by local name.
Instance Attribute Summary collapse
-
#case_flag ⇒ Object
readonly
Returns the value of attribute case_flag.
-
#matcher ⇒ Object
readonly
Returns the value of attribute matcher.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name:, matcher:, value:, case_flag:, namespace: nil) ⇒ AttributeSelector
constructor
A new instance of AttributeSelector.
Constructor Details
#initialize(name:, matcher:, value:, case_flag:, namespace: nil) ⇒ AttributeSelector
Returns a new instance of AttributeSelector.
61 |
# File 'lib/css/selectors/nodes.rb', line 61 def initialize(name:, matcher:, value:, case_flag:, namespace: nil) = super |
Instance Attribute Details
#case_flag ⇒ Object (readonly)
Returns the value of attribute case_flag
59 60 61 |
# File 'lib/css/selectors/nodes.rb', line 59 def case_flag @case_flag end |
#matcher ⇒ Object (readonly)
Returns the value of attribute matcher
59 60 61 |
# File 'lib/css/selectors/nodes.rb', line 59 def matcher @matcher end |
#name ⇒ Object (readonly)
Returns the value of attribute name
59 60 61 |
# File 'lib/css/selectors/nodes.rb', line 59 def name @name end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace
59 60 61 |
# File 'lib/css/selectors/nodes.rb', line 59 def namespace @namespace end |
#value ⇒ Object (readonly)
Returns the value of attribute value
59 60 61 |
# File 'lib/css/selectors/nodes.rb', line 59 def value @value end |