Class: CSS::Selectors::AnB
- Inherits:
-
Data
- Object
- Data
- CSS::Selectors::AnB
- Includes:
- Node
- Defined in:
- lib/css/selectors/nodes.rb
Overview
‘An+B` integer pair. `step` is the `n` coefficient, `offset` is the constant term. `even` => AnB(2, 0), `odd` => AnB(2, 1), `5` => AnB(0, 5), `n` => AnB(1, 0). `of` is the optional `of S` filter (a `SelectorList`), `nil` except on `:nth-child` / `:nth-last-child`.
Instance Attribute Summary collapse
-
#of ⇒ Object
readonly
Returns the value of attribute of.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#step ⇒ Object
readonly
Returns the value of attribute step.
Instance Method Summary collapse
-
#initialize(step:, offset:, of: nil) ⇒ AnB
constructor
A new instance of AnB.
- #to_s ⇒ Object
Constructor Details
#initialize(step:, offset:, of: nil) ⇒ AnB
Returns a new instance of AnB.
77 78 79 |
# File 'lib/css/selectors/nodes.rb', line 77 def initialize(step:, offset:, of: nil) super end |
Instance Attribute Details
#of ⇒ Object (readonly)
Returns the value of attribute of
74 75 76 |
# File 'lib/css/selectors/nodes.rb', line 74 def of @of end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset
74 75 76 |
# File 'lib/css/selectors/nodes.rb', line 74 def offset @offset end |
#step ⇒ Object (readonly)
Returns the value of attribute step
74 75 76 |
# File 'lib/css/selectors/nodes.rb', line 74 def step @step end |
Instance Method Details
#to_s ⇒ Object
81 |
# File 'lib/css/selectors/nodes.rb', line 81 def to_s = Selectors::Serializer.serialize(self) |